From 60e0201060e530ef7a7b0d9f8bbdc538bf4c4fed Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Mon, 17 Oct 2022 18:16:20 +0200 Subject: [PATCH] Added new auto hide config flag CDockManager::AutoHideButtonTogglesArea --- src/DockAreaWidget.cpp | 24 ++++++++++++++++++++---- src/DockManager.h | 17 +++++++++-------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index 2f2c9fb..f23138f 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -1100,12 +1100,28 @@ void CDockAreaWidget::closeArea() void CDockAreaWidget::toggleAutoHideArea(bool Enable) { const auto area = dockContainer()->calculateSideTabBarArea(this); - const auto DockWidget = currentDockWidget(); - if (Enable == isAutoHide()) + + if (dockManager()->testConfigFlag(CDockManager::AutoHideButtonTogglesArea)) { - return; + for (const auto DockWidget : openedDockWidgets()) + { + if (Enable == isAutoHide()) + { + continue; + } + + onAutoHideToggleRequested(DockWidget, !isAutoHide(), area); + } + } + else + { + const auto DockWidget = currentDockWidget(); + if (Enable == isAutoHide()) + { + return; + } + onAutoHideToggleRequested(DockWidget, !isAutoHide(), area); } - onAutoHideToggleRequested(DockWidget, !isAutoHide(), area); } //============================================================================ diff --git a/src/DockManager.h b/src/DockManager.h index b3e6599..a378486 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -226,16 +226,17 @@ public: enum eAutoHideFlag { - DockContainerHasLeftSideBar = 0x01, //!< If the flag is set left side bar will prioritize showing icons only over text - DockContainerHasRightSideBar = 0x02, //!< If the flag is set right side bar will prioritize showing icons only over text - DockContainerHasBottomSideBar = 0x04, //!< If the flag is set right side bar will prioritize showing icons only over text - DockContainerHasTopSideBar = 0x08, //!< If the flag is set right side bar will prioritize showing icons only over text + DockContainerHasLeftSideBar = 0x01, //!< If the flag is set the dock manager will have a left side bar + DockContainerHasRightSideBar = 0x02, //!< If the flag is set the dock manager will have a right side bar + DockContainerHasBottomSideBar = 0x04, //!< If the flag is set the dock manager will have a bottom side bar + DockContainerHasTopSideBar = 0x08, //!< If the flag is set the dock manager will have a top side bar DockAreaHasAutoHideButton = 0x10, //!< If the flag is set each dock area has a auto hide menu button - LeftSideBarPrioritizeIconOnly = 0x20, //!< If the flag is set each container will have a left side bar - RightSideBarPrioritizeIconOnly = 0x40, //!< If the flag is set each container will have a right side bar - BottomSideBarPrioritizeIconOnly = 0x80, //!< If the flag is set bottom side bar will prioritize showing icons only over text - TopSideBarPrioritizeIconOnly = 0x100, //!< If the flag is set bottom side bar will prioritize showing icons only over text + LeftSideBarPrioritizeIconOnly = 0x20, //!< If the flag is set left side bar will prioritize showing icons only over text + RightSideBarPrioritizeIconOnly = 0x40, //!< If the flag is set right side bar will prioritize showing icons only over text + BottomSideBarPrioritizeIconOnly = 0x80,//!< If the flag is set bottom side bar will prioritize showing icons only over text + TopSideBarPrioritizeIconOnly = 0x100, //!< If the flag is set top side bar will prioritize showing icons only over text AutoHideDockAreaHasTitle = 0x200, //!< If the flag is set overlay dock area title bar will show the window title + AutoHideButtonTogglesArea = 0x400, //!< If the flag is set, the auto hide button enables auto hiding for all dock widgets in an area, if disabled, only the current dock widget will be toggled DefaultAutoHideConfig = DockContainerHasLeftSideBar | DockContainerHasRightSideBar