forked from qt-creator/qt-creator
Themes: Make theming of the menu bar optional
Inspired by numerous user feedback, I want to turn off the theming of the menu bar for the new flat theme, and make it look like in the default theme. At the same time, I want to leave the "dark" theme as it currently is. This patch adds a theme flag FlatMenuBar and turns it off for the new theme. Change-Id: I9bba056a27fab7a634b45324e3fe8cd26f50df74 Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
@@ -175,6 +175,7 @@ DrawToolBarHighlights=true
|
||||
ApplyThemePaletteGlobally=true
|
||||
FlatSideBarIcons=true
|
||||
FlatProjectsMode=true
|
||||
FlatMenuBar=true
|
||||
|
||||
[Gradients]
|
||||
DetailsWidgetHeaderGradient\1\color=0
|
||||
|
||||
@@ -77,8 +77,8 @@ InfoBarBackground=ffffffe1
|
||||
InfoBarText=text
|
||||
MenuBarEmptyAreaBackgroundColor=shadowBackground
|
||||
MenuBarItemBackgroundColor=shadowBackground
|
||||
MenuBarItemTextColorDisabled=toolBarItemDisabled
|
||||
MenuBarItemTextColorNormal=toolBarItem
|
||||
MenuBarItemTextColorDisabled=textDisabled
|
||||
MenuBarItemTextColorNormal=text
|
||||
MenuItemTextColorDisabled=textDisabled
|
||||
MenuItemTextColorNormal=text
|
||||
MiniProjectTargetSelectorBackgroundColor=shadowBackground
|
||||
@@ -177,6 +177,7 @@ DrawToolBarHighlights=false
|
||||
ApplyThemePaletteGlobally=false
|
||||
FlatSideBarIcons=true
|
||||
FlatProjectsMode=false
|
||||
FlatMenuBar=false
|
||||
|
||||
[Gradients]
|
||||
DetailsWidgetHeaderGradient\1\color=0
|
||||
|
||||
@@ -169,6 +169,7 @@ DrawToolBarHighlights=true
|
||||
ApplyThemePaletteGlobally=false
|
||||
FlatSideBarIcons=false
|
||||
FlatProjectsMode=false
|
||||
FlatMenuBar=false
|
||||
|
||||
[Gradients]
|
||||
DetailsWidgetHeaderGradient\1\color=ffffff
|
||||
|
||||
@@ -261,7 +261,8 @@ public:
|
||||
DerivePaletteFromTheme,
|
||||
ApplyThemePaletteGlobally,
|
||||
FlatSideBarIcons,
|
||||
FlatProjectsMode
|
||||
FlatProjectsMode,
|
||||
FlatMenuBar
|
||||
};
|
||||
|
||||
enum WidgetStyle {
|
||||
|
||||
@@ -651,7 +651,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
const bool act = mbi->state & (State_Sunken | State_Selected);
|
||||
const bool dis = !(mbi->state & State_Enabled);
|
||||
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleFlat)
|
||||
if (creatorTheme()->flag(Theme::FlatMenuBar))
|
||||
painter->fillRect(option->rect, StyleHelper::isBaseColorDefault()
|
||||
? creatorTheme()->color(Theme::MenuBarItemBackgroundColor)
|
||||
: StyleHelper::baseColor());
|
||||
@@ -784,7 +784,7 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
|
||||
break;
|
||||
|
||||
case CE_MenuBarEmptyArea: {
|
||||
if (creatorTheme()->widgetStyle() == Theme::StyleDefault) {
|
||||
if (!creatorTheme()->flag(Theme::FlatMenuBar)) {
|
||||
StyleHelper::menuGradient(painter, option->rect, option->rect);
|
||||
painter->save();
|
||||
painter->setPen(StyleHelper::borderColor());
|
||||
|
||||
Reference in New Issue
Block a user