diff options
-rw-r--r-- | share/qtcreator/themes/dark.creatortheme | 1 | ||||
-rw-r--r-- | share/qtcreator/themes/default.creatortheme | 1 | ||||
-rw-r--r-- | src/libs/utils/theme/theme.h | 3 | ||||
-rw-r--r-- | src/plugins/coreplugin/coreplugin.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/themesettings.cpp | 2 |
5 files changed, 8 insertions, 1 deletions
diff --git a/share/qtcreator/themes/dark.creatortheme b/share/qtcreator/themes/dark.creatortheme index 774222439a..0853182f6e 100644 --- a/share/qtcreator/themes/dark.creatortheme +++ b/share/qtcreator/themes/dark.creatortheme @@ -108,6 +108,7 @@ DrawIndicatorBranch=true DrawProgressBarSunken=false DrawSearchResultWidgetFrame=false DrawTargetSelectorBottom=false +ApplyThemePaletteGlobally=true [Gradients] DetailsWidgetHeaderGradient\1\color=0 diff --git a/share/qtcreator/themes/default.creatortheme b/share/qtcreator/themes/default.creatortheme index d2dc35fc6c..fd3a6372c2 100644 --- a/share/qtcreator/themes/default.creatortheme +++ b/share/qtcreator/themes/default.creatortheme @@ -102,6 +102,7 @@ DrawIndicatorBranch=false DrawProgressBarSunken=true DrawSearchResultWidgetFrame=true DrawTargetSelectorBottom=true +ApplyThemePaletteGlobally=false [Gradients] DetailsWidgetHeaderGradient\1\color=ffffff diff --git a/src/libs/utils/theme/theme.h b/src/libs/utils/theme/theme.h index d9b41c15ca..ef1ac85b7c 100644 --- a/src/libs/utils/theme/theme.h +++ b/src/libs/utils/theme/theme.h @@ -184,7 +184,8 @@ public: DrawProgressBarSunken, DrawIndicatorBranch, ComboBoxDrawTextShadow, - DerivePaletteFromTheme + DerivePaletteFromTheme, + ApplyThemePaletteGlobally }; enum WidgetStyle { diff --git a/src/plugins/coreplugin/coreplugin.cpp b/src/plugins/coreplugin/coreplugin.cpp index e77dec4fee..62be9d7c2e 100644 --- a/src/plugins/coreplugin/coreplugin.cpp +++ b/src/plugins/coreplugin/coreplugin.cpp @@ -131,6 +131,8 @@ void CorePlugin::parseArguments(const QStringList &arguments) Theme *theme = new Theme(qApp); theme->readSettings(themeSettings); setCreatorTheme(theme); + if (theme->flag(Theme::ApplyThemePaletteGlobally)) + QApplication::setPalette(creatorTheme()->palette(QApplication::palette())); // defer creation of these widgets until here, // because they need a valid theme set diff --git a/src/plugins/coreplugin/themesettings.cpp b/src/plugins/coreplugin/themesettings.cpp index 75fd3ed2f5..1332e59d86 100644 --- a/src/plugins/coreplugin/themesettings.cpp +++ b/src/plugins/coreplugin/themesettings.cpp @@ -434,6 +434,8 @@ void ThemeSettings::apply() { d->m_ui->editor->model()->toTheme(creatorTheme()); + if (creatorTheme()->flag(Theme::ApplyThemePaletteGlobally)) + QApplication::setPalette(creatorTheme()->palette(QApplication::palette())); foreach (QWidget *w, QApplication::topLevelWidgets()) w->update(); } |