From 78134ea8b71a34daad2f29600972e605e2bd778f Mon Sep 17 00:00:00 2001 From: Popa Adrian Marius Date: Wed, 29 Apr 2026 06:51:02 +0300 Subject: [PATCH 1/2] style configurator - fix orange theme bug and dark mode default (#550) --- conf-defs/fr_settings.confdef | 2 +- src/gui/PreferencesDialogStyle.cpp | 12 ++++++++++-- xml-styles/stylers.xml | 2 +- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/conf-defs/fr_settings.confdef b/conf-defs/fr_settings.confdef index e35b0daa..bf012a7c 100644 --- a/conf-defs/fr_settings.confdef +++ b/conf-defs/fr_settings.confdef @@ -432,7 +432,7 @@ Select the file with the primary style StyleTheme - styles + stylers 1 StyleTheme diff --git a/src/gui/PreferencesDialogStyle.cpp b/src/gui/PreferencesDialogStyle.cpp index 6ad86306..e8c117a8 100644 --- a/src/gui/PreferencesDialogStyle.cpp +++ b/src/gui/PreferencesDialogStyle.cpp @@ -220,7 +220,12 @@ bool PrefDlgStyleSetting::loadFromTargetConfig(Config& config) if (fileComboBoxM) { wxString value = defaultM; - config.getValue(keyM, value); + // If system is dark and no value in config, use DarkModeDefault + if (wxSystemSettings::GetAppearance().IsDark() && !config.keyExists(keyM)) + value = "DarkModeDefault"; + else + config.getValue(keyM, value); + fileComboBoxM->SetValue(value); loadStylers(fileComboBoxM->GetValue()); @@ -229,7 +234,10 @@ bool PrefDlgStyleSetting::loadFromTargetConfig(Config& config) if (fileSecondaryComboBoxM) { wxString value = defaultM; - config.getValue("StyleThemeSecondary", value); + if (wxSystemSettings::GetAppearance().IsDark() && !config.keyExists("StyleThemeSecondary")) + value = "DarkModeDefault"; + else + config.getValue("StyleThemeSecondary", value); fileSecondaryComboBoxM->SetValue(value); } diff --git a/xml-styles/stylers.xml b/xml-styles/stylers.xml index b791dfb4..76448c0a 100644 --- a/xml-styles/stylers.xml +++ b/xml-styles/stylers.xml @@ -33,7 +33,7 @@ - + From d32953880955878a943f3eeb724f42a589aa8083 Mon Sep 17 00:00:00 2001 From: Popa Adrian Marius Date: Wed, 29 Apr 2026 11:12:12 +0300 Subject: [PATCH 2/2] style configurator - address code review suggestions (#550) --- src/gui/FRStyleManager.cpp | 3 ++- src/gui/FRStyleManager.h | 2 ++ src/gui/PreferencesDialogStyle.cpp | 12 ++++-------- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/FRStyleManager.cpp b/src/gui/FRStyleManager.cpp index 312a9de1..652647e6 100644 --- a/src/gui/FRStyleManager.cpp +++ b/src/gui/FRStyleManager.cpp @@ -37,6 +37,7 @@ #include "FRStyleManager.h" +const wxString FRStyleManager::_DARKMODEDEFAULT = "DarkModeDefault"; FRStyleManager& stylerManager() { @@ -349,7 +350,7 @@ void FRStyleManager::loadConfig() // user's explicit Preferences choice still wins. const wxString systemDefault = wxSystemSettings::GetAppearance().IsDark() - ? wxString("DarkModeDefault") + ? _DARKMODEDEFAULT : _default; wxString fileName = config().get(_PRYMARY, systemDefault); diff --git a/src/gui/FRStyleManager.h b/src/gui/FRStyleManager.h index af82a6e9..ddb978fa 100644 --- a/src/gui/FRStyleManager.h +++ b/src/gui/FRStyleManager.h @@ -36,6 +36,8 @@ class FRStyleManager : public Subject const wxString _SECONDARY = "StyleThemeSecondary"; const wxString _STYLEACTIVE = "StyleActive"; const wxString _default = "stylers"; +public: + static const wxString _DARKMODEDEFAULT; wxFileName fileNamePrimaryM; wxFileName fileNameSecondaryM; diff --git a/src/gui/PreferencesDialogStyle.cpp b/src/gui/PreferencesDialogStyle.cpp index e8c117a8..aec362dd 100644 --- a/src/gui/PreferencesDialogStyle.cpp +++ b/src/gui/PreferencesDialogStyle.cpp @@ -221,10 +221,8 @@ bool PrefDlgStyleSetting::loadFromTargetConfig(Config& config) { wxString value = defaultM; // If system is dark and no value in config, use DarkModeDefault - if (wxSystemSettings::GetAppearance().IsDark() && !config.keyExists(keyM)) - value = "DarkModeDefault"; - else - config.getValue(keyM, value); + if (!config.getValue(keyM, value) && wxSystemSettings::GetAppearance().IsDark()) + value = FRStyleManager::_DARKMODEDEFAULT; fileComboBoxM->SetValue(value); @@ -234,10 +232,8 @@ bool PrefDlgStyleSetting::loadFromTargetConfig(Config& config) if (fileSecondaryComboBoxM) { wxString value = defaultM; - if (wxSystemSettings::GetAppearance().IsDark() && !config.keyExists("StyleThemeSecondary")) - value = "DarkModeDefault"; - else - config.getValue("StyleThemeSecondary", value); + if (!config.getValue("StyleThemeSecondary", value) && wxSystemSettings::GetAppearance().IsDark()) + value = FRStyleManager::_DARKMODEDEFAULT; fileSecondaryComboBoxM->SetValue(value); }