diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-10-26 16:12:41 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2020-10-28 09:15:59 +0000 |
commit | 4fce7868ea8c62ad37d99f80397aef5dc3b08406 (patch) | |
tree | b08ebfe03d20cb423cf019f8c779c62415b8742c | |
parent | 1bb225211c91f3c90fc2f84e269c398a8fdba2c7 (diff) |
QMacStyle - more pixel refinements
There is 1 pixel of a rounded corner visible both on NSButton and
NSPopupButton in a tab widget (all orientations) - adjust the rectangle
for this.
Task-number: QTBUG-86513
Change-Id: I5e203adc583d2fba6323b18328ccbc8b0c0666ea
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
(cherry picked from commit 3857f104cac127f62e64e55a20613f0ac2e6b843)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 6b74205fda..51dbec4513 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3901,9 +3901,22 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter frameRect = frameRect.adjusted(-innerAdjust, 0, outerAdjust, 0); else frameRect = frameRect.adjusted(-outerAdjust, 0, innerAdjust, 0); + + if (isSelected && isBigSurOrAbove) { + // 1 pixed of 'roundness' is still visible on the right + // (the left is OK, it's rounded). + frameRect = frameRect.adjusted(0, 0, 1, 0); + } + break; case QStyleOptionTab::Middle: frameRect = frameRect.adjusted(-innerAdjust, 0, innerAdjust, 0); + + if (isSelected && isBigSurOrAbove) { + // 1 pixel of 'roundness' is still visible on both + // sides - left and right. + frameRect = frameRect.adjusted(-1, 0, 1, 0); + } break; case QStyleOptionTab::End: // Pressed state hack: tweak adjustments in preparation for flip below @@ -3911,6 +3924,11 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter frameRect = frameRect.adjusted(-innerAdjust, 0, outerAdjust, 0); else frameRect = frameRect.adjusted(-outerAdjust, 0, innerAdjust, 0); + + if (isSelected && isBigSurOrAbove) { + // 1 pixel of 'roundness' is still visible on the left. + frameRect = frameRect.adjusted(-1, 0, 0, 0); + } break; case QStyleOptionTab::OnlyOneTab: frameRect = frameRect.adjusted(-outerAdjust, 0, outerAdjust, 0); |