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 0e643bf783)
This commit is contained in:
Timur Pocheptsov 2020-02-13 12:06:14 +01:00
parent ee73ec0c77
commit 379895798e

View File

@ -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) {