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:
@@ -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