diff --git a/src/core/appearance.h b/src/core/appearance.h index b3d59e86b..31fffc677 100644 --- a/src/core/appearance.h +++ b/src/core/appearance.h @@ -35,8 +35,8 @@ class Appearance : public QObject { static const char* kUseCustomColorSet; static const char* kForegroundColor; static const char* kBackgroundColor; - static const QPalette kDefaultPalette; + private: QColor foreground_color_; QColor background_color_; diff --git a/src/ui/mainwindow.cpp b/src/ui/mainwindow.cpp index 5b0e9b186..3f9da7686 100644 --- a/src/ui/mainwindow.cpp +++ b/src/ui/mainwindow.cpp @@ -690,6 +690,9 @@ MainWindow::MainWindow( // Load theme appearance_ = new Appearance(this); + // This is tricky: we need to save the default/system palette now, before + // loading user preferred theme (which will overide it), to be able to restore it later + const_cast(Appearance::kDefaultPalette) = QApplication::palette(); appearance_->LoadUserTheme(); StyleSheetLoader* css_loader = new StyleSheetLoader(this); css_loader->SetStyleSheet(this, ":mainwindow.css");