diff options
author | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-01-12 12:11:34 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@qt.io> | 2022-01-12 22:27:21 +0100 |
commit | cd446a7e250671c8994ee32395fe20a59d768466 (patch) | |
tree | c0d3255695b6a9bcfe6e8507a9a76926ae63efd2 /src/plugins/styles/mac/qmacstyle_mac.mm | |
parent | c30af31f990aef5ff5ea0e6eb2c6ba9681f9c7ba (diff) |
QMacStyle: fix a regression introduced by a button type change
Since we (re)use NSButton to render tab items, the 'momentary push in'
button type breaks the tab. Temporary restore the old 'push on/push off'
type if rendering a tab.
Pick-to: 6.2 6.3 5.15
Fixes: QTBUG-99743
Change-Id: I54b11c1a35373292ecf0bcd5cf7b4ea4203cc031
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 9d57248673..d395d1da63 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -3963,6 +3963,13 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter } pb.frame = frameRect.toCGRect(); + if (!isPopupButton) { + // Note: these days we use 'momentary push in' for Button_PushButton, + // but tabs are also rendered using NSButton/ButtonPushButton, and + // here we need 'push on/off' to make it work (tab highlight colors). + pb.buttonType = NSButtonTypePushOnPushOff; + } + pb.enabled = isEnabled; [pb highlight:isPressed]; // Set off state when inactive. See needsInactiveHack for when it's selected |