From 4d77c37522b51861037f0ec3ee9d4d13951672ff Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 18 Mar 2019 16:21:26 +0100 Subject: QMacStyle - make focus ring less transparent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit But only for the 'Light' theme. For "Dark" the system color fits well (without our rather strange and random 0.5 we set for some reason). Change-Id: Ic5c8372913515611a567090f82852ffc7ca14eb7 Fixes: QTBUG-74095 Reviewed-by: Tor Arne Vestbø --- src/plugins/styles/mac/qmacstyle_mac.mm | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 13ef98b840..979f70ece5 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -1227,11 +1227,17 @@ void QMacStylePrivate::drawFocusRing(QPainter *p, const QRectF &targetRect, int Q_UNREACHABLE(); } - const auto focusRingColor = qt_mac_toQColor(NSColor.keyboardFocusIndicatorColor.CGColor); + auto focusRingColor = qt_mac_toQColor(NSColor.keyboardFocusIndicatorColor.CGColor); + if (!qt_mac_applicationIsInDarkMode()) { + // This color already has alpha ~ 0.25, this value is too small - the ring is + // very pale and nothing like the native one. 0.39 makes it better (not ideal + // anyway). The color seems to be correct in dark more without any modification. + focusRingColor.setAlphaF(0.39); + } p->save(); p->setRenderHint(QPainter::Antialiasing); - p->setOpacity(0.5); + if (cw.type == SegmentedControl_First) { // TODO Flip left-right } -- cgit v1.2.3