summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorTimur Pocheptsov <timur.pocheptsov@qt.io>2020-02-13 12:06:14 +0100
committerTimur Pocheptsov <timur.pocheptsov@qt.io>2020-02-18 18:05:50 +0000
commit379895798eb3db0af30c7db2da01c3f8e187446a (patch)
treef7ea2bfd4acc343b67acde5d464bcb7ee59b29c2 /src/plugins
parentee73ec0c77dc040771d7f983df16e97ed5ac9cd3 (diff)
QMacStyle - fix tab buttons
not to have arrows under some conditions. NSPopUpButton had a needed color, except it also has arrow(s). Which looks quite confusing on an inactive window on a tab button. Fixes: QTBUG-82122 Change-Id: I40c57abe9ccae48fa906d592169c412f5f89f712 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> (cherry picked from commit 0e643bf7830949ade66e76a6eefa99b4b24c422b)
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/styles/mac/qmacstyle_mac.mm13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm
index ecdde06bb8..71eb88008e 100644
--- a/src/plugins/styles/mac/qmacstyle_mac.mm
+++ b/src/plugins/styles/mac/qmacstyle_mac.mm
@@ -3935,7 +3935,20 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter
CGContextRotateCTM(ctx, M_PI_2);
}
+ // Now, if it's a trick with a popup button, it has an arrow
+ // which makes no sense on tabs.
+ NSPopUpArrowPosition oldPosition = NSPopUpArrowAtCenter;
+ NSPopUpButtonCell *pbCell = nil;
+ if (isPopupButton) {
+ pbCell = static_cast<NSPopUpButtonCell *>(pb.cell);
+ oldPosition = pbCell.arrowPosition;
+ pbCell.arrowPosition = NSPopUpNoArrow;
+ }
+
[pb.cell drawBezelWithFrame:r inView:pb.superview];
+
+ if (pbCell) // Restore, we may reuse it for a ComboBox.
+ pbCell.arrowPosition = oldPosition;
};
if (needsInactiveHack) {