Core: Draw the separator also under a menu with "FlatMenuBar" flag

That separator under the Menu is drawn in the Classic and Flat themes.

This change ensures that it is also drawn for themes with "FlatMenuBar".
The "Flat Dark" and "Flat Light" need it.

Change-Id: I43c932cfc4634330a08f86a33c9d74555e420a2a
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@theqtcompany.com>
This commit is contained in:
Alessandro Portale
2016-07-04 13:57:19 +02:00
committed by Alessandro Portale
parent b963ad78bb
commit 794d901c30

View File

@@ -790,16 +790,16 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
break; break;
case CE_MenuBarEmptyArea: { case CE_MenuBarEmptyArea: {
if (!creatorTheme()->flag(Theme::FlatMenuBar)) { if (creatorTheme()->flag(Theme::FlatMenuBar))
StyleHelper::menuGradient(painter, option->rect, option->rect);
painter->save();
painter->setPen(StyleHelper::borderColor());
painter->drawLine(option->rect.bottomLeft() + QPointF(0.5, 0.5),
option->rect.bottomRight() + QPointF(0.5, 0.5));
painter->restore();
} else {
painter->fillRect(option->rect, StyleHelper::baseColor()); painter->fillRect(option->rect, StyleHelper::baseColor());
} else
StyleHelper::menuGradient(painter, option->rect, option->rect);
painter->save();
painter->setPen(StyleHelper::borderColor());
painter->drawLine(option->rect.bottomLeft() + QPointF(0.5, 0.5),
option->rect.bottomRight() + QPointF(0.5, 0.5));
painter->restore();
} }
break; break;