diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-03-18 16:21:26 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2019-03-22 05:10:08 +0000 |
commit | 4d77c37522b51861037f0ec3ee9d4d13951672ff (patch) | |
tree | ef6704eb27334858764b5e78c51ac9ef632669d4 /src/plugins/styles/mac/qmacstyle_mac.mm | |
parent | 66fc17eb5c40568032ece0621c1ba0ffbf230b78 (diff) |
QMacStyle - make focus ring less transparent
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ø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 10 |
1 files changed, 8 insertions, 2 deletions
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 } |