Save default QApplication palette when starting Clementine

Update issue 2603
Hopefully, this will fix this issue for other systems this time...
This commit is contained in:
Arnaud Bienner 2012-01-14 16:27:49 +01:00
parent 97d8365c56
commit da35fab076
2 changed files with 4 additions and 1 deletions

View File

@ -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_;

View File

@ -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<QPalette&>(Appearance::kDefaultPalette) = QApplication::palette();
appearance_->LoadUserTheme();
StyleSheetLoader* css_loader = new StyleSheetLoader(this);
css_loader->SetStyleSheet(this, ":mainwindow.css");