Remove strange icon highlight for active menu item

Windows and macOS do not highlight the icon for an active menu item.
It requires quite a few kludges in styles and/or stylesheets
to make it behave and we simply should not highlight this icon.

[ChangeLog][QtWidgets][QMenu] Removed icon highlight when a
stylesheet was applied the application.

Task-number: QTBUG-69199
Change-Id: I35c5b255766254d11312d7f86c625b811d1dfd64
Reviewed-by: Morten Kristensen <msk@nullpointer.dk>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@qt.io>
This commit is contained in:
Thorbjørn Lund Martsum 2018-06-29 08:51:53 +02:00
parent 4f066d1071
commit 678b0cf6c3

View File

@ -1148,9 +1148,6 @@ void QWindowsStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPai
pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode); pixmap = menuitem->icon.pixmap(proxy()->pixelMetric(PM_SmallIconSize, opt, widget), mode);
const int pixw = pixmap.width() / pixmap.devicePixelRatio(); const int pixw = pixmap.width() / pixmap.devicePixelRatio();
const int pixh = pixmap.height() / pixmap.devicePixelRatio(); const int pixh = pixmap.height() / pixmap.devicePixelRatio();
if (act && !dis && !checked)
qDrawShadePanel(p, vCheckRect, menuitem->palette, false, 1,
&menuitem->palette.brush(QPalette::Button));
QRect pmr(0, 0, pixw, pixh); QRect pmr(0, 0, pixw, pixh);
pmr.moveCenter(vCheckRect.center()); pmr.moveCenter(vCheckRect.center());
p->setPen(menuitem->palette.text().color()); p->setPen(menuitem->palette.text().color());