diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-02-13 14:14:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-20 22:12:47 +0100 |
commit | 3b8b47db6aaeb333f106cff57cc712b01d828302 (patch) | |
tree | ddc23c12694293279f0fb5aba33f23d5b280e13d /src/widgets/widgets/qmainwindow.cpp | |
parent | 2bc7a40048ada41c59ddac0988bb2e04c227a18d (diff) |
Set unified toolbar height accurately.
Add registerContentBorderArea() to the Cocoa native
interface which allows registering multiple "unified
toolbar" areas for each window.
Use this function in QToolBarLayout::setGeometry()
to register the area for each TopToolBarArea toolbar.
Task-number: QTBUG-36700
Change-Id: I52efcc5662556bb94f25f504be3710d0491f79b9
Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
Reviewed-by: Denis Dzyubenko <denis@ddenis.info>
Diffstat (limited to 'src/widgets/widgets/qmainwindow.cpp')
-rw-r--r-- | src/widgets/widgets/qmainwindow.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/widgets/widgets/qmainwindow.cpp b/src/widgets/widgets/qmainwindow.cpp index 07db78c06c..1d0268a244 100644 --- a/src/widgets/widgets/qmainwindow.cpp +++ b/src/widgets/widgets/qmainwindow.cpp @@ -1508,19 +1508,17 @@ void QMainWindow::setUnifiedTitleAndToolBarOnMac(bool set) #ifdef Q_OS_OSX Q_D(QMainWindow); if (isWindow()) { + d->useUnifiedToolBar = set; + createWinId(); + QPlatformNativeInterface *nativeInterface = QGuiApplication::platformNativeInterface(); QPlatformNativeInterface::NativeResourceForIntegrationFunction function = - nativeInterface->nativeResourceFunctionForIntegration("setContentBorderThickness"); + nativeInterface->nativeResourceFunctionForIntegration("enableContentBorderArea"); if (!function) return; // Not Cocoa platform plugin. - createWinId(); - - d->useUnifiedToolBar = set; - - const int toolBarHeight = 50; - typedef void (*SetContentBorderThicknessFunction)(QWindow *window, int topThickness, int bottomThickness); - (reinterpret_cast<SetContentBorderThicknessFunction>(function))(window()->windowHandle(), toolBarHeight, 0); + typedef void (*EnableContentBorderAreaFunction)(QWindow *window, bool enable); + (reinterpret_cast<EnableContentBorderAreaFunction>(function))(window()->windowHandle(), set); } #endif |