OS X: Fix broken 2x menu icon when style sheet is applied

Task-number: QTBUG-41623
Change-Id: I4e0640a7739d0ce4f8758dd5d8d17882a6947467
Reviewed-by: Alessandro Portale <alessandro.portale@digia.com>
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
MihailNaydenov 2014-09-26 19:42:39 +03:00 committed by Oswald Buddenhagen
parent b0098056e5
commit 6fa2fec1dd

View File

@ -3583,8 +3583,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q
pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On); pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On);
else else
pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode); pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode);
int pixw = pixmap.width(); const int pixw = pixmap.width() / pixmap.devicePixelRatio();
int pixh = pixmap.height(); const int pixh = pixmap.height() / pixmap.devicePixelRatio();
QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon); QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon);
if (!iconRule.hasGeometry()) { if (!iconRule.hasGeometry()) {
iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1); iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1);