mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-04-06 00:32:05 +02:00
fix a bug that switching from dark mode to light mode didn't work on Windows
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user