mirror of
https://github.com/cemu-project/Cemu.git
synced 2025-12-12 10:37:02 +00:00
Downgrade wxWidgets to prevent regression with row colors in light mode
This commit is contained in:
parent
cd31a9e3aa
commit
ad39c0c516
4 changed files with 11 additions and 14 deletions
|
|
@ -1,8 +1,8 @@
|
||||||
vcpkg_from_github(
|
vcpkg_from_github(
|
||||||
OUT_SOURCE_PATH SOURCE_PATH
|
OUT_SOURCE_PATH SOURCE_PATH
|
||||||
REPO wxWidgets/wxWidgets
|
REPO wxWidgets/wxWidgets
|
||||||
REF "f3da561"
|
REF "bfd436b"
|
||||||
SHA512 04e273b83ec683ed18ff5278371441b5ecf5897d34a896307cb59c58fb7adf68a70f6af3b3193bb1c63b9985edd5e6807202c05af3202a54c4142518ed15a71b
|
SHA512 bd3fd6d0d0db3b6fa34eceae1119e21ffd2f62221dcd249f8b8b82a6e65d83a05101e4e1e4ca9b9c4d7937add73b113bb029b03b05d2c3d87d17c1922d800a24
|
||||||
HEAD_REF master
|
HEAD_REF master
|
||||||
PATCHES
|
PATCHES
|
||||||
install-layout.patch
|
install-layout.patch
|
||||||
|
|
|
||||||
|
|
@ -452,25 +452,22 @@ void wxGameList::UpdateItemColors(sint32 startIndex)
|
||||||
{
|
{
|
||||||
wxWindowUpdateLocker lock(this);
|
wxWindowUpdateLocker lock(this);
|
||||||
|
|
||||||
wxColour bgColourPrimary = GetBackgroundColour();
|
|
||||||
wxColour bgColourSecondary = wxHelper::CalculateAccentColour(bgColourPrimary);
|
|
||||||
|
|
||||||
for (int i = startIndex; i < GetItemCount(); ++i)
|
for (int i = startIndex; i < GetItemCount(); ++i)
|
||||||
{
|
{
|
||||||
const auto titleId = (uint64)GetItemData(i);
|
const uint64 titleId = GetItemData(i);
|
||||||
if (GetConfig().IsGameListFavorite(titleId))
|
if (GetConfig().IsGameListFavorite(titleId))
|
||||||
{
|
{
|
||||||
SetItemBackgroundColour(i, kFavoriteColor);
|
SetItemBackgroundColour(i, kFavoriteColor);
|
||||||
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||||
}
|
}
|
||||||
else if ((i&1) != 0)
|
else if ((i % 2) != 0)
|
||||||
{
|
{
|
||||||
SetItemBackgroundColour(i, bgColourPrimary);
|
SetItemBackgroundColour(i, kPrimaryColor);
|
||||||
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
SetItemBackgroundColour(i, bgColourSecondary);
|
SetItemBackgroundColour(i, kAlternateColor);
|
||||||
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
SetItemTextColour(i, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOWTEXT));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -3,15 +3,15 @@
|
||||||
#include "config/CemuConfig.h"
|
#include "config/CemuConfig.h"
|
||||||
#include "Cafe/TitleList/TitleId.h"
|
#include "Cafe/TitleList/TitleId.h"
|
||||||
|
|
||||||
#include <future>
|
|
||||||
#include <mutex>
|
#include <mutex>
|
||||||
#include <optional>
|
|
||||||
|
|
||||||
#include <wx/listctrl.h>
|
#include <wx/listctrl.h>
|
||||||
#include <wx/timer.h>
|
#include <wx/timer.h>
|
||||||
#include <wx/panel.h>
|
#include <wx/panel.h>
|
||||||
#include <wx/settings.h>
|
#include <wx/settings.h>
|
||||||
#include <Cafe/TitleList/GameInfo.h>
|
#include <Cafe/TitleList/GameInfo.h>
|
||||||
|
|
||||||
|
#include "wxHelper.h"
|
||||||
#include "util/helpers/Semaphore.h"
|
#include "util/helpers/Semaphore.h"
|
||||||
|
|
||||||
class wxTitleIdEvent : public wxCommandEvent
|
class wxTitleIdEvent : public wxCommandEvent
|
||||||
|
|
@ -66,7 +66,8 @@ private:
|
||||||
|
|
||||||
const wxColour kUpdateColor{ wxSystemSettings::SelectLightDark(wxColour(195, 57, 57), wxColour(84, 29, 29)) };
|
const wxColour kUpdateColor{ wxSystemSettings::SelectLightDark(wxColour(195, 57, 57), wxColour(84, 29, 29)) };
|
||||||
const wxColour kFavoriteColor{ wxSystemSettings::SelectLightDark(wxColour(253, 246, 211), wxColour(82, 84, 48)) };
|
const wxColour kFavoriteColor{ wxSystemSettings::SelectLightDark(wxColour(253, 246, 211), wxColour(82, 84, 48)) };
|
||||||
const wxColour kSecondColor{ wxSystemSettings::SelectLightDark(wxColour(242, 249, 253), wxColour(34, 34, 34)) };
|
const wxColour kPrimaryColor = GetBackgroundColour();
|
||||||
|
const wxColour kAlternateColor = wxHelper::CalculateAccentColour(kPrimaryColor);
|
||||||
void UpdateItemColors(sint32 startIndex = 0);
|
void UpdateItemColors(sint32 startIndex = 0);
|
||||||
|
|
||||||
enum ItemColumns : int
|
enum ItemColumns : int
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,9 @@ namespace wxHelper
|
||||||
|
|
||||||
inline wxColour CalculateAccentColour(const wxColour& bgColour)
|
inline wxColour CalculateAccentColour(const wxColour& bgColour)
|
||||||
{
|
{
|
||||||
wxColour bgColourSecondary;
|
|
||||||
const uint32 bgLightness = (bgColour.GetRed() + bgColour.GetGreen() + bgColour.GetBlue()) / 3;
|
const uint32 bgLightness = (bgColour.GetRed() + bgColour.GetGreen() + bgColour.GetBlue()) / 3;
|
||||||
const bool isDarkTheme = bgLightness < 128;
|
const bool isDarkTheme = bgLightness < 128;
|
||||||
bgColourSecondary = bgColour.ChangeLightness(isDarkTheme ? 110 : 90); // color for even 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
|
// for very light themes we'll use a blue tint to match the older Windows Cemu look
|
||||||
if (bgLightness > 250)
|
if (bgLightness > 250)
|
||||||
bgColourSecondary = wxColour(bgColour.Red() - 13, bgColour.Green() - 6, bgColour.Blue() - 2);
|
bgColourSecondary = wxColour(bgColour.Red() - 13, bgColour.Green() - 6, bgColour.Blue() - 2);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue