diff --git a/src/DockAreaTitleBar.cpp b/src/DockAreaTitleBar.cpp index ef29a26..d5af9bf 100644 --- a/src/DockAreaTitleBar.cpp +++ b/src/DockAreaTitleBar.cpp @@ -415,7 +415,12 @@ void CDockAreaTitleBar::onTabsMenuAboutToShow() void CDockAreaTitleBar::onCloseButtonClicked() { ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked"); - if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab)) + if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock) && + d->DockArea->autoHideDockContainer()) + { + d->DockArea->autoHideDockContainer()->collapseView(true); + } + else if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab)) { d->TabBar->closeTab(d->TabBar->currentIndex()); } diff --git a/src/DockManager.h b/src/DockManager.h index e0f9d44..f723f11 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -245,6 +245,7 @@ public: AutoHideButtonCheckable = 0x08, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes. AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container + AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container closes the dock instead of hiding it completely DefaultAutoHideConfig = AutoHideFeatureEnabled | DockAreaHasAutoHideButton ///< the default configuration for left and right side bars