From 6fa2fec1dd3834515b6a898c304ba81b8b91df2f Mon Sep 17 00:00:00 2001 From: MihailNaydenov Date: Fri, 26 Sep 2014 19:42:39 +0300 Subject: OS X: Fix broken 2x menu icon when style sheet is applied MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Task-number: QTBUG-41623 Change-Id: I4e0640a7739d0ce4f8758dd5d8d17882a6947467 Reviewed-by: Alessandro Portale Reviewed-by: Morten Johan Sørvig --- src/widgets/styles/qstylesheetstyle.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/widgets/styles/qstylesheetstyle.cpp b/src/widgets/styles/qstylesheetstyle.cpp index 60bfc8e075..8c52b24869 100644 --- a/src/widgets/styles/qstylesheetstyle.cpp +++ b/src/widgets/styles/qstylesheetstyle.cpp @@ -3583,8 +3583,8 @@ void QStyleSheetStyle::drawControl(ControlElement ce, const QStyleOption *opt, Q pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode, QIcon::On); else pixmap = mi.icon.pixmap(pixelMetric(PM_SmallIconSize), mode); - int pixw = pixmap.width(); - int pixh = pixmap.height(); + const int pixw = pixmap.width() / pixmap.devicePixelRatio(); + const int pixh = pixmap.height() / pixmap.devicePixelRatio(); QRenderRule iconRule = renderRule(w, opt, PseudoElement_MenuIcon); if (!iconRule.hasGeometry()) { iconRule.geo = new QStyleSheetGeometryData(pixw, pixh, pixw, pixh, -1, -1); -- cgit v1.2.3