mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-19 19:33:47 +00: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.
|
// 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();
|
// When the user has explicitly chosen a mode, honour it directly.
|
||||||
//const unsigned luma = get_colour_approx_luma(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
|
// Falling through to check_dark_mode() for an explicit "0" would query
|
||||||
//return luma < 128;
|
// 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
|
#endif
|
||||||
#else
|
#else
|
||||||
//BBS disable DarkUI mode
|
//BBS disable DarkUI mode
|
||||||
|
|||||||
Reference in New Issue
Block a user