Fix for dark_mode(): Use check_dark_mode() function only, when app_config doesn't have a "dark_color_mode" parameter.

Now wxWidgets improved IsDark() function with 622a2f9d60.
So now it returns correct color for the system appearance
This commit is contained in:
YuSanka 2022-08-10 16:48:37 +02:00
parent fc6ca282dd
commit f994e42d8e
2 changed files with 3 additions and 12 deletions

View File

@ -1410,9 +1410,9 @@ bool GUI_App::dark_mode()
// proper dark mode was first introduced. // proper dark mode was first introduced.
return wxPlatformInfo::Get().CheckOSVersion(10, 14) && mac_dark_mode(); return wxPlatformInfo::Get().CheckOSVersion(10, 14) && mac_dark_mode();
#else #else
return wxGetApp().app_config->get("dark_color_mode") == "1" ? true : check_dark_mode(); if (wxGetApp().app_config->has("dark_color_mode"))
//const unsigned luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW)); return wxGetApp().app_config->get("dark_color_mode") == "1";
//return luma < 128; return check_dark_mode();
#endif #endif
} }

View File

@ -153,15 +153,6 @@ wxFont get_default_font_for_dpi(const wxWindow *window, int dpi)
} }
bool check_dark_mode() { bool check_dark_mode() {
#if 0 //#ifdef _WIN32 // #ysDarkMSW - Allow it when we deside to support the sustem colors for application
wxRegKey rk(wxRegKey::HKCU,
"Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize");
if (rk.Exists() && rk.HasValue("AppsUseLightTheme")) {
long value = -1;
rk.QueryValue("AppsUseLightTheme", &value);
return value <= 0;
}
#endif
#if wxCHECK_VERSION(3,1,3) #if wxCHECK_VERSION(3,1,3)
return wxSystemSettings::GetAppearance().IsDark(); return wxSystemSettings::GetAppearance().IsDark();
#else #else