diff options
author | Andy Shaw <andy.shaw@nokia.com> | 2010-02-04 15:14:00 (GMT) |
---|---|---|
committer | Andy Shaw <andy.shaw@nokia.com> | 2010-02-04 15:14:00 (GMT) |
commit | f3bd6565674f163b058bc235670d45631ce559ee (patch) | |
tree | 88f0d117b0bccaf6e30f50222ec2017edfb14d77 /src/gui/styles | |
parent | 38d31452b3cafd738c215b5686bf3ff95c1d27d6 (diff) | |
download | Qt-f3bd6565674f163b058bc235670d45631ce559ee.zip Qt-f3bd6565674f163b058bc235670d45631ce559ee.tar.gz Qt-f3bd6565674f163b058bc235670d45631ce559ee.tar.bz2 |
Another fix for the non unified title+toolbar regarding text under icons
This makes the case where there is text under the icons in toolbuttons
and the title and toolbar is not unified on Mac. This was a regression
against Qt 4.5.x
Reviewed-by: jbache
Diffstat (limited to 'src/gui/styles')
-rw-r--r-- | src/gui/styles/qmacstyle_mac.mm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/gui/styles/qmacstyle_mac.mm b/src/gui/styles/qmacstyle_mac.mm index aab16cb..78074c7 100644 --- a/src/gui/styles/qmacstyle_mac.mm +++ b/src/gui/styles/qmacstyle_mac.mm @@ -3380,8 +3380,14 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - pr.setHeight(pixmap.size().height()); - cr.adjust(0, pr.bottom() + 1, 0, 1); + QMainWindow *mw = qobject_cast<QMainWindow *>(w->window()); + if (mw && mw->unifiedTitleAndToolBarOnMac()) { + pr.setHeight(pixmap.size().height()); + cr.adjust(0, pr.bottom() + 1, 0, 1); + } else { + pr.setHeight(pixmap.size().height() + 6); + cr.adjust(0, pr.bottom(), 0, -3); + } alignment |= Qt::AlignCenter; } else { pr.setWidth(pixmap.width() + 8); |