diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-02-13 12:06:14 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2020-02-13 12:15:25 +0100 |
commit | 0e643bf7830949ade66e76a6eefa99b4b24c422b (patch) | |
tree | 04608c7a5153936a4fbc4ed4a4bdd13dcb842181 /src/plugins/styles | |
parent | 8e74bf4d4aaaf582c70cbcb83caa237e2592e762 (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>
Diffstat (limited to 'src/plugins/styles')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 13 |
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 a5ab8eeb17..d5ad1a8ca0 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3972,7 +3972,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) { |