From f209eb464cfa1a4f0f58640b59fd5c834c8bf7e0 Mon Sep 17 00:00:00 2001 From: Volker Hilsheimer Date: Tue, 6 Jul 2021 10:57:19 +0200 Subject: [PATCH] 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 (cherry picked from commit eaa48136a39f153b05bb1842734bbe2277191510) Reviewed-by: Qt Cherry-pick Bot --- src/plugins/styles/mac/qmacstyle_mac.mm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 2030b47923e..bb75391ab6e 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -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();