Added new auto hide config flag CDockManager::AutoHideButtonTogglesArea

This commit is contained in:
Uwe Kindler 2022-10-17 18:16:20 +02:00
parent 90b92900a1
commit 60e0201060
2 changed files with 29 additions and 12 deletions

View File

@ -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);
}
//============================================================================

View File

@ -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