forked from qt-creator/qt-creator
Theming: Allow to apply theme palette globally
Change-Id: I709bd6b6c566e016731af1fb94ddaef6326ef485 Reviewed-by: Thorben Kroeger <thorbenkroeger@gmail.com> Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
48a90eea3c
commit
82bbc6f562
@@ -108,6 +108,7 @@ DrawIndicatorBranch=true
|
|||||||
DrawProgressBarSunken=false
|
DrawProgressBarSunken=false
|
||||||
DrawSearchResultWidgetFrame=false
|
DrawSearchResultWidgetFrame=false
|
||||||
DrawTargetSelectorBottom=false
|
DrawTargetSelectorBottom=false
|
||||||
|
ApplyThemePaletteGlobally=true
|
||||||
|
|
||||||
[Gradients]
|
[Gradients]
|
||||||
DetailsWidgetHeaderGradient\1\color=0
|
DetailsWidgetHeaderGradient\1\color=0
|
||||||
|
@@ -102,6 +102,7 @@ DrawIndicatorBranch=false
|
|||||||
DrawProgressBarSunken=true
|
DrawProgressBarSunken=true
|
||||||
DrawSearchResultWidgetFrame=true
|
DrawSearchResultWidgetFrame=true
|
||||||
DrawTargetSelectorBottom=true
|
DrawTargetSelectorBottom=true
|
||||||
|
ApplyThemePaletteGlobally=false
|
||||||
|
|
||||||
[Gradients]
|
[Gradients]
|
||||||
DetailsWidgetHeaderGradient\1\color=ffffff
|
DetailsWidgetHeaderGradient\1\color=ffffff
|
||||||
|
@@ -184,7 +184,8 @@ public:
|
|||||||
DrawProgressBarSunken,
|
DrawProgressBarSunken,
|
||||||
DrawIndicatorBranch,
|
DrawIndicatorBranch,
|
||||||
ComboBoxDrawTextShadow,
|
ComboBoxDrawTextShadow,
|
||||||
DerivePaletteFromTheme
|
DerivePaletteFromTheme,
|
||||||
|
ApplyThemePaletteGlobally
|
||||||
};
|
};
|
||||||
|
|
||||||
enum WidgetStyle {
|
enum WidgetStyle {
|
||||||
|
@@ -131,6 +131,8 @@ void CorePlugin::parseArguments(const QStringList &arguments)
|
|||||||
Theme *theme = new Theme(qApp);
|
Theme *theme = new Theme(qApp);
|
||||||
theme->readSettings(themeSettings);
|
theme->readSettings(themeSettings);
|
||||||
setCreatorTheme(theme);
|
setCreatorTheme(theme);
|
||||||
|
if (theme->flag(Theme::ApplyThemePaletteGlobally))
|
||||||
|
QApplication::setPalette(creatorTheme()->palette(QApplication::palette()));
|
||||||
|
|
||||||
// defer creation of these widgets until here,
|
// defer creation of these widgets until here,
|
||||||
// because they need a valid theme set
|
// because they need a valid theme set
|
||||||
|
@@ -434,6 +434,8 @@ void ThemeSettings::apply()
|
|||||||
|
|
||||||
{
|
{
|
||||||
d->m_ui->editor->model()->toTheme(creatorTheme());
|
d->m_ui->editor->model()->toTheme(creatorTheme());
|
||||||
|
if (creatorTheme()->flag(Theme::ApplyThemePaletteGlobally))
|
||||||
|
QApplication::setPalette(creatorTheme()->palette(QApplication::palette()));
|
||||||
foreach (QWidget *w, QApplication::topLevelWidgets())
|
foreach (QWidget *w, QApplication::topLevelWidgets())
|
||||||
w->update();
|
w->update();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user