Commit 04a68518 authored by Alessandro Portale's avatar Alessandro Portale

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: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent b6c1e58f
......@@ -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());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment