macOS 10.15: Fix focus frame for combo boxes

Amends df31696321 to take care
of macOS 10.15 specifically, where the focus ring is a pixel
too high and leaves a gap that's visible on high-dpi displays.

On macOS 10.14 and before, and for editable comboboxes, the focus
frame is correct.

Fixes: QTBUG-94069
Pick-to: 6.2 6.1 5.15
Change-Id: I278aa30036808c06f8e71385d4797315e46d8f1d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
This commit is contained in:
Volker Hilsheimer 2021-07-06 10:57:19 +02:00
parent 81411003a4
commit eaa48136a3

View File

@ -1233,6 +1233,8 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRectF &targetRect, int
QRectF focusRect = targetRect;
if (isBigSurOrAbove)
focusRect.translate(0, -1.5);
else if (QOperatingSystemVersion::current() >= QOperatingSystemVersion::MacOSCatalina)
focusRect.adjust(0, 0, 0, -1);
const qreal innerRadius = cw.type == Button_PushButton ? 3 : 4;
const qreal outerRadius = innerRadius + focusRingWidth;
hOffset = focusRect.left();