diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2013-12-16 23:06:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-01-12 01:25:55 +0100 |
commit | 4a7f27ea536c2010edae05f39c1a9cb6c56205f1 (patch) | |
tree | 2eb94a945845ce6fef8a382dfb96fd350dc20cef /src/widgets | |
parent | b3d642e71e1b1083e5f17872614da2cbf38e8fbe (diff) | |
download | qtbase-4a7f27ea536c2010edae05f39c1a9cb6c56205f1.tar.gz |
Mac: remove unified toolbar workarounds.
QMainWindow::unifiedTitleAndToolBarOnMac() will
again return true, but the new implementation is
much more similar to the cross platform one so these
workarounds are not needed.
Task-number: QTBUG-34411
Change-Id: Ic95f491af94354776385dc984f1a00c64429a3f0
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/styles/qmacstyle_mac.mm | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/src/widgets/styles/qmacstyle_mac.mm b/src/widgets/styles/qmacstyle_mac.mm index 8c00f06a4f..d13339b555 100644 --- a/src/widgets/styles/qmacstyle_mac.mm +++ b/src/widgets/styles/qmacstyle_mac.mm @@ -2437,11 +2437,6 @@ int QMacStyle::pixelMetric(PixelMetric metric, const QStyleOption *opt, const QW break; case PM_ToolBarFrameWidth: ret = 1; - if (widget) { - if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent())) - if (mainWindow->unifiedTitleAndToolBarOnMac()) - ret = 0; - } break; case PM_ScrollView_ScrollBarOverlap: #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7 @@ -3445,14 +3440,8 @@ void QMacStyle::drawControl(ControlElement ce, const QStyleOption *opt, QPainter if (tb->toolButtonStyle != Qt::ToolButtonIconOnly) { needText = true; if (tb->toolButtonStyle == Qt::ToolButtonTextUnderIcon) { - QMainWindow *mw = w ? qobject_cast<QMainWindow *>(w->window()) : 0; - if (mw && mw->unifiedTitleAndToolBarOnMac()) { - pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio()); - cr.adjust(0, pr.bottom() + 1, 0, 1); - } else { - pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio() + 6); - cr.adjust(0, pr.bottom(), 0, -3); - } + pr.setHeight(pixmap.size().height() / pixmap.devicePixelRatio() + 6); + cr.adjust(0, pr.bottom(), 0, -3); alignment |= Qt::AlignCenter; } else { pr.setWidth(pixmap.width() / pixmap.devicePixelRatio() + 8); @@ -6271,18 +6260,6 @@ QSize QMacStyle::sizeFromContents(ContentsType ct, const QStyleOption *opt, } break; case CT_ToolButton: - if (widget && qobject_cast<const QToolBar *>(widget->parentWidget())) { - if (QMainWindow * mainWindow = qobject_cast<QMainWindow *>(widget->parent())) { - if (mainWindow->unifiedTitleAndToolBarOnMac()) { - sz.rwidth() += 4; - if (sz.height() <= 32) { - // Workaround strange HIToolBar bug when getting constraints. - sz.rheight() += 1; - } - return sz; - } - } - } sz.rwidth() += 10; sz.rheight() += 10; return sz; |