Skip to content

Commit 0cac9ac

Browse files
Merge branch 'close_button_collapse_dock' of https://github.com/duerr-ndt/Qt-Advanced-Docking-System into duerr-ndt-close_button_collapse_dock
2 parents 7a79eca + b467685 commit 0cac9ac

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/DockAreaTitleBar.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,12 @@ void CDockAreaTitleBar::onTabsMenuAboutToShow()
415415
void CDockAreaTitleBar::onCloseButtonClicked()
416416
{
417417
ADS_PRINT("CDockAreaTitleBar::onCloseButtonClicked");
418-
if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
418+
if (CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock) &&
419+
d->DockArea->autoHideDockContainer())
420+
{
421+
d->DockArea->autoHideDockContainer()->collapseView(true);
422+
}
423+
else if (d->testConfigFlag(CDockManager::DockAreaCloseButtonClosesTab))
419424
{
420425
d->TabBar->closeTab(d->TabBar->currentIndex());
421426
}

src/DockManager.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -245,6 +245,7 @@ public Q_SLOTS:
245245
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.
246246
AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
247247
AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
248+
AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container closes the dock instead of hiding it completely
248249

249250
DefaultAutoHideConfig = AutoHideFeatureEnabled
250251
| DockAreaHasAutoHideButton ///< the default configuration for left and right side bars

0 commit comments

Comments
 (0)