From f2db946fa4d660d4e4fbddb777a8ef7df05d2282 Mon Sep 17 00:00:00 2001 From: Alessandro Portale Date: Fri, 7 Jul 2017 14:10:15 +0200 Subject: QWidgets/FusionStyle: Fix menu drawing under HighDPI Delegating the border painting to qDrawPlainRect ensures that there are no off-by-one pixel issues. Task-number: QTBUG-61845 Change-Id: I732795e048cbc2e5b279782e9a19700884f8bc40 Reviewed-by: Friedemann Kleint --- src/widgets/styles/qfusionstyle.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/widgets/styles/qfusionstyle.cpp b/src/widgets/styles/qfusionstyle.cpp index 983413d149..dd8b1b1d69 100644 --- a/src/widgets/styles/qfusionstyle.cpp +++ b/src/widgets/styles/qfusionstyle.cpp @@ -990,11 +990,9 @@ void QFusionStyle::drawPrimitive(PrimitiveElement elem, break; case PE_PanelMenu: { painter->save(); - QColor menuBackground = option->palette.base().color().lighter(108); + const QBrush menuBackground = option->palette.base().color().lighter(108); QColor borderColor = option->palette.background().color().darker(160); - painter->setPen(borderColor); - painter->setBrush(menuBackground); - painter->drawRect(option->rect.adjusted(0, 0, -1, -1)); + qDrawPlainRect(painter, option->rect, borderColor, 1, &menuBackground); painter->restore(); } break; -- cgit v1.2.3