fix a bug that switching from dark mode to light mode didn't work on Windows

This commit is contained in:
SoftFever
2026-03-29 23:51:17 +08:00
parent eefdabcd98
commit 7d7f26ed69

View File

@@ -3645,9 +3645,15 @@ bool GUI_App::dark_mode()
// proper dark mode was first introduced.
return wxPlatformInfo::Get().CheckOSVersion(10, 14) && mac_dark_mode();
#else
return wxGetApp().app_config->get("dark_color_mode") == "1" ? true : check_dark_mode();
//const unsigned luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
//return luma < 128;
// When the user has explicitly chosen a mode, honour it directly.
// Falling through to check_dark_mode() for an explicit "0" would query
// wxSystemSettings::GetAppearance().IsDark(), which is contaminated by
// wxWidgets 3.3's MSWEnableDarkMode(DarkMode_Auto) and can return true
// even though the user asked for light mode.
const auto &val = wxGetApp().app_config->get("dark_color_mode");
if (val == "1") return true;
if (val == "0") return false;
return check_dark_mode();
#endif
#else
//BBS disable DarkUI mode