Merge pull request #5505 from spycrab/wx_stars

Wx: Implement new, themed stars
This commit is contained in:
shuffle2 2017-06-02 18:44:48 -07:00 committed by GitHub
commit 0b63fcc78f

View File

@ -297,11 +297,14 @@ CGameListCtrl::~CGameListCtrl()
template <typename T> template <typename T>
static void InitBitmap(wxImageList* img_list, std::vector<int>* vector, wxWindow* context, static void InitBitmap(wxImageList* img_list, std::vector<int>* vector, wxWindow* context,
const wxSize& usable_size, T index, const std::string& name) const wxSize& usable_size, T index, const std::string& name,
bool themed = false)
{ {
wxSize size = img_list->GetSize(); wxSize size = img_list->GetSize();
(*vector)[static_cast<size_t>(index)] = img_list->Add(WxUtils::LoadScaledResourceBitmap( auto bitmap_fnc = themed ? WxUtils::LoadScaledThemeBitmap : WxUtils::LoadScaledResourceBitmap;
name, context, size, usable_size, WxUtils::LSI_SCALE | WxUtils::LSI_ALIGN_VCENTER)); (*vector)[static_cast<size_t>(index)] = img_list->Add(
bitmap_fnc(name, context, size, usable_size, WxUtils::LSI_SCALE | WxUtils::LSI_ALIGN_VCENTER,
wxTransparentColour));
} }
void CGameListCtrl::InitBitmaps() void CGameListCtrl::InitBitmaps()
@ -354,12 +357,12 @@ void CGameListCtrl::InitBitmaps()
"Platform_File"); "Platform_File");
m_EmuStateImageIndex.resize(6); m_EmuStateImageIndex.resize(6);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 0, "rating0"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 0, "rating0", true);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 1, "rating1"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 1, "rating1", true);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 2, "rating2"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 2, "rating2", true);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 3, "rating3"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 3, "rating3", true);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 4, "rating4"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 4, "rating4", true);
InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 5, "rating5"); InitBitmap(img_list, &m_EmuStateImageIndex, this, rating_bmp_size, 5, "rating5", true);
m_utility_game_banners.resize(1); m_utility_game_banners.resize(1);
InitBitmap(img_list, &m_utility_game_banners, this, size, 0, "nobanner"); InitBitmap(img_list, &m_utility_game_banners, this, size, 0, "nobanner");