diff options
author | Gabriel de Dietrich <gabriel.dedietrich@digia.com> | 2012-11-30 16:07:00 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2012-12-01 08:30:49 +0100 |
commit | bc0cbdb9815082901d7aad11cb739615793b2012 (patch) | |
tree | 905816282a734fcd8cbb093db082b4323be96850 /src | |
parent | 95a05904b9dfd48865dcdc0ef8941db794bb5d06 (diff) |
Mac: Fix small button metrics, menu indicator alignment
Task-number: QTBUG-28275
Change-Id: I08de3cc7fee3af725c66ed081072277b2ca32601
Reviewed-by: Samuel Rødal <samuel.rodal@digia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index fe7e51b6f6..759b3678d7 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -3553,8 +3553,9 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (btn->features & QStyleOptionButton::HasMenu) { int mbi = proxy()->pixelMetric(QStyle::PM_MenuButtonIndicator, btn, w); QRect ir = btn->rect; + int arrowYOffset = bdi.kind == kThemePushButton ? 4 : 2; HIRect arrowRect = CGRectMake(ir.right() - mbi - QMacStylePrivate::PushButtonRightOffset, - ir.height() / 2 - 4, mbi, ir.height() / 2); + ir.height() / 2 - arrowYOffset, mbi, ir.height() / 2); bool drawColorless = btn->palette.currentColorGroup() == QPalette::Active; if (drawColorless && tds == kThemeStateInactive) tds = kThemeStateActive; @@ -6072,7 +6073,10 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, // Do this by add enough space around the contents so that rounded // borders (including highlighting when active) will show. sz.rwidth() += QMacStylePrivate::PushButtonLeftOffset + QMacStylePrivate::PushButtonRightOffset + 12; - sz.rheight() += 4; + if (opt->state & QStyle::State_Small) + sz.rheight() += 14; + else + sz.rheight() += 4; break; case QStyle::CT_MenuItem: if (const QStyleOptionMenuItem *mi = qstyleoption_cast<const QStyleOptionMenuItem *>(opt)) { |