macOS 10.15: Fix focus frame for combo boxes

Amends df316963213e765de5b94469622df48b0c9a9e6e 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
Change-Id: I278aa30036808c06f8e71385d4797315e46d8f1d
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
(cherry picked from commit eaa48136a39f153b05bb1842734bbe2277191510)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2021-07-06 10:57:19 +02:00 committed by Qt Cherry-pick Bot
parent 66c2f31ec9
commit f209eb464c

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();