Add config flag for enabling the overlay dock area title

Changed the config name from DefaultDockContainerConfig->DefaultAutoHideConfig
This commit is contained in:
Syarif Fakhri 2022-09-08 16:58:40 +08:00
parent 60c22000a8
commit a2e9c1aa9c
3 changed files with 7 additions and 6 deletions

View File

@ -26,7 +26,7 @@ CMainWindow::CMainWindow(QWidget *parent)
CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true); CDockManager::setConfigFlag(CDockManager::OpaqueSplitterResize, true);
CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false); CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false);
CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true); CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true);
CDockManager::setConfigFlag(CDockManager::DefaultDockContainerConfig, true); CDockManager::setConfigFlag(CDockManager::DefaultAutoHideConfig, true);
DockManager = new CDockManager(this); DockManager = new CDockManager(this);
// Set central widget // Set central widget

View File

@ -815,7 +815,7 @@ void CDockAreaWidget::updateTitleBarVisibility()
d->TitleBar->setVisible(isOverlayed() ? true : !Hidden); // Titlebar must always be visible when overlayed so it can be dragged d->TitleBar->setVisible(isOverlayed() ? true : !Hidden); // Titlebar must always be visible when overlayed so it can be dragged
auto tabBar = d->TitleBar->tabBar(); auto tabBar = d->TitleBar->tabBar();
tabBar->setVisible(isOverlayed() ? false : !Hidden); // Never show tab bar when overlayed tabBar->setVisible(isOverlayed() ? false : !Hidden); // Never show tab bar when overlayed
d->TitleBar->overlayTitleLabel()->setVisible(isOverlayed()); // Always show when overlayed, never otherwise d->TitleBar->overlayTitleLabel()->setVisible(CDockManager::testConfigFlag(CDockManager::DockAreaOverlayHasTitle) && isOverlayed()); // Always show when overlayed, never otherwise
updateTitleBarButtonVisibility(Container->topLevelDockArea() == this); updateTitleBarButtonVisibility(Container->topLevelDockArea() == this);
} }
} }

View File

@ -206,15 +206,16 @@ public:
DockAreaHasAutoHideButton = 0x4000000, //!< If the flag is set each dock area has a auto hide menu button DockAreaHasAutoHideButton = 0x4000000, //!< If the flag is set each dock area has a auto hide menu button
DockContainerHasLeftSideBar = 0x8000000, //!< If the flag is set each container will have a left side bar DockContainerHasLeftSideBar = 0x8000000, //!< If the flag is set each container will have a left side bar
DockContainerHasRightSideBar = 0x10000000, //!< If the flag is set each container will have a right side bar DockContainerHasRightSideBar = 0x10000000, //!< If the flag is set each container will have a right side bar
DockAreaOverlayHasTitle = 0x20000000, //!< If the flag is set overlay dock area title bar will show the window title
DefaultDockAreaButtons = DockAreaHasCloseButton DefaultDockAreaButtons = DockAreaHasCloseButton
| DockAreaHasUndockButton | DockAreaHasUndockButton
| DockAreaHasTabsMenuButton, ///< default configuration of dock area title bar buttons | DockAreaHasTabsMenuButton, ///< default configuration of dock area title bar buttons
DefaultDockContainerConfig = DockContainerHasLeftSideBar DefaultAutoHideConfig = DockContainerHasLeftSideBar
| DockContainerHasRightSideBar | DockContainerHasRightSideBar
| DockAreaHasAutoHideButton, ///< the default configuration for left and right side bars | DockAreaHasAutoHideButton
| DockAreaOverlayHasTitle, ///< the default configuration for left and right side bars
DefaultBaseConfig = DefaultDockAreaButtons DefaultBaseConfig = DefaultDockAreaButtons
| ActiveTabHasCloseButton | ActiveTabHasCloseButton