From 4dd961d5b26230015d9ad637deb5d41494eeaa3e Mon Sep 17 00:00:00 2001 From: Hanif Koh Date: Mon, 12 Oct 2026 15:10:56 +0800 Subject: [PATCH] Refresh Dark Mode Colours When the System Theme Differs at Startup On Linux and macOS the app follows the system theme: at startup it overwrites the saved dark_color_mode with the system appearance. The label colours and the cached dark mode flag were already set from the saved value by then, and the later "changed" check reads the mode only after the overwrite, so it never fires. For that session every dialog that maps its colours through UpdateDlgDarkUI keeps the old mode, e.g. white dialogs on a dark main window after switching the desktop to dark, or on a fresh install on a dark desktop. Refresh the label colours and the flag when the system theme differs from the saved mode. --- src/slic3r/GUI/GUI_App.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/slic3r/GUI/GUI_App.cpp b/src/slic3r/GUI/GUI_App.cpp index 8940e13e6e..636ba985f5 100644 --- a/src/slic3r/GUI/GUI_App.cpp +++ b/src/slic3r/GUI/GUI_App.cpp @@ -3232,9 +3232,16 @@ bool GUI_App::on_init_inner() #ifdef _MSW_DARK_MODE #ifndef __WINDOWS__ + // The label colours and the dark mode flag were set above from the saved mode. When the system theme + // differs from it, refresh them, or dialogs that map their colours stay in the old mode for this session. + const bool saved_dark_mode = dark_mode(); wxSystemAppearance app = wxSystemSettings::GetAppearance(); GUI::wxGetApp().app_config->set("dark_color_mode", app.IsDark() ? "1" : "0"); GUI::wxGetApp().app_config->save(); + if (dark_mode() != saved_dark_mode) { + init_label_colours(); + Update_dark_mode_flag(); + } #endif // __APPLE__