summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-01-21 10:17:50 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-22 22:31:36 (GMT)
commit40db54f8182e427f76c663aec15c3a6a682b3c9f (patch)
tree2f10c7bf3fc52a5956491acf413f75112b52b68a
parent05651ca4be506eaf9714a3f37c629a58c5c5856d (diff)
downloadQt-40db54f8182e427f76c663aec15c3a6a682b3c9f.zip
Qt-40db54f8182e427f76c663aec15c3a6a682b3c9f.tar.gz
Qt-40db54f8182e427f76c663aec15c3a6a682b3c9f.tar.bz2
QWindowVistaStyle: Always initialize text color of menu items.
[ChangeLog][QtWidgets][QMenu][Windows] Correctly use text color set by style sheet for menu items. Task-number: QTBUG-36142 Change-Id: I142f2fd82164771b45bf599a6afa1121fcfd2187 Reviewed-by: Jens Bache-Wiig <jens.bache-wiig@digia.com> (cherry picked from qtbase/b152b425f74788b2f2845fb7d1a5032d86b8746d)
-rw-r--r--src/gui/styles/qwindowsvistastyle.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/gui/styles/qwindowsvistastyle.cpp b/src/gui/styles/qwindowsvistastyle.cpp
index c14dfb5..abe729b 100644
--- a/src/gui/styles/qwindowsvistastyle.cpp
+++ b/src/gui/styles/qwindowsvistastyle.cpp
@@ -1344,11 +1344,9 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
painter->setPen(menuitem->palette.buttonText().color());
- QColor discol;
- if (dis) {
- discol = menuitem->palette.text().color();
- painter->setPen(discol);
- }
+ const QColor textColor = menuitem->palette.text().color();
+ if (dis)
+ painter->setPen(textColor);
int xm = windowsItemFrame + checkcol + windowsItemHMargin;
int xpos = menuitem->rect.x() + xm;
@@ -1372,7 +1370,7 @@ void QWindowsVistaStyle::drawControl(ControlElement element, const QStyleOption
if (menuitem->menuItemType == QStyleOptionMenuItem::DefaultItem)
font.setBold(true);
painter->setFont(font);
- painter->setPen(discol);
+ painter->setPen(textColor);
painter->drawText(vTextRect, text_flags, s.left(t));
painter->restore();
}