mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-07-04 05:51:19 +12:00
Fix various colour values for dark themes (#439)
This commit is contained in:
parent
94b179ef5a
commit
2842615edb
5 changed files with 28 additions and 17 deletions
|
@ -358,16 +358,9 @@ long wxGameList::GetStyleFlags(Style style) const
|
|||
void wxGameList::UpdateItemColors(sint32 startIndex)
|
||||
{
|
||||
wxWindowUpdateLocker lock(this);
|
||||
// get the background color so we can determine the theme in use
|
||||
wxColour bgColour = GetBackgroundColour();
|
||||
uint32 bgLightness = (bgColour.GetRed() + bgColour.GetGreen() + bgColour.GetBlue()) / 3;
|
||||
bool isDarkTheme = bgLightness < 128;
|
||||
wxColour bgColourPrimary = bgColour; // color for odd rows
|
||||
wxColour bgColourSecondary = bgColour.ChangeLightness(isDarkTheme ? 110 : 90); // color for even rows
|
||||
|
||||
// for very light themes we'll use a blue tint to match the older Windows Cemu look
|
||||
if (bgLightness > 250)
|
||||
bgColourSecondary = wxColour(bgColour.Red() - 13, bgColour.Green() - 6, bgColour.Blue() - 2);
|
||||
wxColour bgColourPrimary = GetBackgroundColour();
|
||||
wxColour bgColourSecondary = wxHelper::CalculateAccentColour(bgColourPrimary);
|
||||
|
||||
for (int i = startIndex; i < GetItemCount(); ++i)
|
||||
{
|
||||
|
@ -1143,4 +1136,4 @@ bool wxGameList::QueryIconForTitle(TitleId titleId, int& icon, int& iconSmall)
|
|||
void wxGameList::DeleteCachedStrings()
|
||||
{
|
||||
m_name_cache.clear();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue