Skip to content

Commit b467685

Browse files
author
Syarif Fakhri
committed
Add config to make close button collapse auto hide dock
1 parent f2d8e17 commit b467685

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
@@ -239,6 +239,7 @@ class ADS_EXPORT CDockManager : public CDockContainerWidget
239239
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.
240240
AutoHideSideBarsIconOnly = 0x10,///< show only icons in auto hide side tab - if a tab has no icon, then the text will be shown
241241
AutoHideShowOnMouseOver = 0x20, ///< show the auto hide window on mouse over tab and hide it if mouse leaves auto hide container
242+
AutoHideCloseButtonCollapsesDock = 0x40, ///< Close button of an auto hide container closes the dock instead of hiding it completely
242243

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

0 commit comments

Comments
 (0)