Wx: Implement new, themed stars

This commit is contained in:
spycrab 2017-06-02 22:38:56 +02:00
parent 25f24d32ff
commit 1d8ba6f865

View File

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