From 583d8ced5afa684d8dc38501d1249ff20274ed63 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Tue, 1 Nov 2016 11:26:09 +0100 Subject: [PATCH] Theme Settings: Fix that options page switched back to current theme - Changing the theme settings and reopening options page switched back to current theme - When passing a theme on the command line, closing the options dialog would state that the theme change takes effect after restart, even if theme was not changed Fix these issues by showing the current theme setting in the options page, ignoring the currently active theme, and showing a label telling the currently active theme instead. Task-number: QTCREATORBUG-15852 Change-Id: I343fc729c33f17fcb15a8e9facd7a49076d0e0d1 Reviewed-by: Leena Miettinen Reviewed-by: Alessandro Portale --- src/plugins/coreplugin/themechooser.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/plugins/coreplugin/themechooser.cpp b/src/plugins/coreplugin/themechooser.cpp index ab695aeea82..34020e2cd96 100644 --- a/src/plugins/coreplugin/themechooser.cpp +++ b/src/plugins/coreplugin/themechooser.cpp @@ -38,6 +38,7 @@ #include #include #include +#include #include #include #include @@ -136,13 +137,17 @@ ThemeChooserPrivate::ThemeChooserPrivate(QWidget *widget) { QHBoxLayout *layout = new QHBoxLayout(widget); layout->addWidget(m_themeComboBox); + auto overriddenLabel = new QLabel; + overriddenLabel->setText(ThemeChooser::tr("Current theme: %1") + .arg(creatorTheme()->displayName())); + layout->addWidget(overriddenLabel); layout->setMargin(0); auto horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); layout->addSpacerItem(horizontalSpacer); m_themeComboBox->setModel(m_themeListModel); const QList themes = ThemeEntry::availableThemes(); - const Id activeTheme = Id::fromString(creatorTheme()->id()); - const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id, activeTheme)); + const Id themeSetting = ThemeEntry::themeSetting(); + const int selected = Utils::indexOf(themes, Utils::equal(&ThemeEntry::id, themeSetting)); m_themeListModel->setThemes(themes); if (selected >= 0) m_themeComboBox->setCurrentIndex(selected);