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 <Friedemann.Kleint@qt.io>
This commit is contained in:
parent
b6d5026b1f
commit
f2db946fa4
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user