diff options
Diffstat (limited to 'src/plugins/styles/mac/qmacstyle_mac.mm')
-rw-r--r-- | src/plugins/styles/mac/qmacstyle_mac.mm | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/plugins/styles/mac/qmacstyle_mac.mm b/src/plugins/styles/mac/qmacstyle_mac.mm index 58061b1ae4..01d4a06c61 100644 --- a/src/plugins/styles/mac/qmacstyle_mac.mm +++ b/src/plugins/styles/mac/qmacstyle_mac.mm @@ -4642,15 +4642,13 @@ QRect QMacStyle::subElementRect(SubElement sr, const QStyleOption *opt, auto frameRect = cw.adjustedControlFrame(btn->rect); if (sr == SE_PushButtonContents) { frameRect -= cw.titleMargins(); - } else { + } else if (cw.type != QMacStylePrivate::Button_SquareButton) { auto *pb = static_cast<NSButton *>(d->cocoaControl(cw)); - if (cw.type != QMacStylePrivate::Button_SquareButton) { - frameRect = QRectF::fromCGRect([pb alignmentRectForFrame:pb.frame]); - if (cw.type == QMacStylePrivate::Button_PushButton) - frameRect -= pushButtonShadowMargins[cw.size]; - else if (cw.type == QMacStylePrivate::Button_PullDown) - frameRect -= pullDownButtonShadowMargins[cw.size]; - } + frameRect = QRectF::fromCGRect([pb alignmentRectForFrame:frameRect.toCGRect()]); + if (cw.type == QMacStylePrivate::Button_PushButton) + frameRect -= pushButtonShadowMargins[cw.size]; + else if (cw.type == QMacStylePrivate::Button_PullDown) + frameRect -= pullDownButtonShadowMargins[cw.size]; } rect = frameRect.toRect(); } |