From 0f2acaf1cb6be5290f64842667e60b6675b467c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20Johan=20S=C3=B8rvig?= Date: Mon, 31 Mar 2014 12:19:20 +0200 Subject: Cocoa: Update unified toolbar area on toolbar hide Add setContentBorderAreaEnabled() which us used to enable or disable an area. Used together with registerContentBorderArea() this allows changing the border area geometry and enabled status independently. Add section to the QToolBar show/hide event handler which calls setContentBorderAreaEnabled(). Make sure QToolBar and QToolBarLayout uses the same identifier - the QToolBar object pointer. Rename enableContentBorderArea -> setContentBorderEnabled. The "ContentBorder" is now the entire unified toolbar area while "ContentBorderArea"s are the sub-areas covered by toolbars. Change-Id: I339f381a50856e048ae40e7ffadd6a8a510c4994 Reviewed-by: Gabriel de Dietrich --- src/widgets/widgets/qtoolbarlayout.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/widgets/widgets/qtoolbarlayout.cpp') diff --git a/src/widgets/widgets/qtoolbarlayout.cpp b/src/widgets/widgets/qtoolbarlayout.cpp index 020d180778..efd33da7fc 100644 --- a/src/widgets/widgets/qtoolbarlayout.cpp +++ b/src/widgets/widgets/qtoolbarlayout.cpp @@ -369,9 +369,9 @@ void QToolBarLayout::updateMacBorderMetrics() typedef void (*RegisterContentBorderAreaFunction)(QWindow *window, void *identifier, int upper, int lower); if (mainWindow->toolBarArea(tb) == Qt::TopToolBarArea) { - (reinterpret_cast(function))(tb->window()->windowHandle(), this, upper.y(), lower.y()); + (reinterpret_cast(function))(tb->window()->windowHandle(), tb, upper.y(), lower.y()); } else { - (reinterpret_cast(function))(tb->window()->windowHandle(), this, 0, 0); + (reinterpret_cast(function))(tb->window()->windowHandle(), tb, 0, 0); } #endif } -- cgit v1.2.3