diff options
Diffstat (limited to 'src/widgets/widgets/qtoolbar.cpp')
-rw-r--r-- | src/widgets/widgets/qtoolbar.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/widgets/widgets/qtoolbar.cpp b/src/widgets/widgets/qtoolbar.cpp index 53b77c34da..3fd615c3c7 100644 --- a/src/widgets/widgets/qtoolbar.cpp +++ b/src/widgets/widgets/qtoolbar.cpp @@ -1040,6 +1040,21 @@ static bool waitForPopup(QToolBar *tb, QWidget *popup) return false; } +#ifdef Q_OS_OSX +static void enableMacToolBar(QToolBar *toolbar, bool enable) +{ + QPlatformNativeInterface *nativeInterface = QApplication::platformNativeInterface(); + QPlatformNativeInterface::NativeResourceForIntegrationFunction function = + nativeInterface->nativeResourceFunctionForIntegration("setContentBorderAreaEnabled"); + if (!function) + return; // Not Cocoa platform plugin. + + typedef void (*SetContentBorderAreaEnabledFunction)(QWindow *window, void *identifier, bool enabled); + (reinterpret_cast<SetContentBorderAreaEnabledFunction>(function))(toolbar->window()->windowHandle(), toolbar, enable); +} +#endif + + /*! \reimp */ bool QToolBar::event(QEvent *event) { @@ -1062,6 +1077,9 @@ bool QToolBar::event(QEvent *event) // fallthrough intended case QEvent::Show: d->toggleViewAction->setChecked(event->type() == QEvent::Show); +#ifdef Q_OS_OSX + enableMacToolBar(this, event->type() == QEvent::Show); +#endif emit visibilityChanged(event->type() == QEvent::Show); break; case QEvent::ParentChange: |