From 3857f104cac127f62e64e55a20613f0ac2e6b843 Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 26 Oct 2020 16:12:41 +0100 Subject: QMacStyle - more pixel refinements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. Pick-to: 5.15 Pick-to: 5.12 Task-number: QTBUG-86513 Change-Id: I5e203adc583d2fba6323b18328ccbc8b0c0666ea Reviewed-by: Tor Arne Vestbø --- src/plugins/styles/mac/qmacstyle_mac.mm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src/plugins/styles') diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 8fac7a4277..34568ee44a 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3875,9 +3875,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 @@ -3885,6 +3898,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); -- cgit v1.2.3