Theming: Fix menu item highlight for the themed (flat) menu bar

Since StyleHelper::baseColor now returns a themed color and
QColor::lighter() lightens up dark colors relatively little, we should
to use a themed color for the background instead.

Task-number: QTCREATORBUG-15930
Change-Id: I256ddcf946a14af6937c324a76e3f3a24919ae3b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Alessandro Portale
2016-03-29 18:52:35 +02:00
parent 610176358b
commit 063c8d45c8

View File

@@ -666,11 +666,15 @@ void ManhattanStyle::drawControl(ControlElement element, const QStyleOption *opt
if (act) {
// Fill|
QColor baseColor = StyleHelper::baseColor();
QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft());
grad.setColorAt(0, baseColor.lighter(120));
grad.setColorAt(1, baseColor.lighter(130));
painter->fillRect(option->rect, grad);
if (creatorTheme()->flag(Theme::FlatMenuBar)) {
painter->fillRect(option->rect, creatorTheme()->color(Theme::FancyToolButtonHoverColor));
} else {
QColor baseColor = StyleHelper::baseColor();
QLinearGradient grad(option->rect.topLeft(), option->rect.bottomLeft());
grad.setColorAt(0, baseColor.lighter(120));
grad.setColorAt(1, baseColor.lighter(130));
painter->fillRect(option->rect, grad);
}
QPalette pal = mbi->palette;
uint alignment = Qt::AlignCenter | Qt::TextShowMnemonic | Qt::TextDontClip | Qt::TextSingleLine;