diff --git a/demo/MainWindow.cpp b/demo/MainWindow.cpp index 733a9e8..ba5db06 100644 --- a/demo/MainWindow.cpp +++ b/demo/MainWindow.cpp @@ -654,7 +654,7 @@ CMainWindow::CMainWindow(QWidget *parent) : CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true); // uncomment if you would like to enable dock widget auto hiding - CDockManager::setConfigFlag(CDockManager::DefaultAutoHideConfig, true); + CDockManager::setConfigFlags(CDockManager::DefaultAutoHideConfig); // uncomment if you would like to enable an equal distribution of the // available size of a splitter to all contained dock widgets diff --git a/src/DockAreaWidget.cpp b/src/DockAreaWidget.cpp index fa66f85..db49d69 100644 --- a/src/DockAreaWidget.cpp +++ b/src/DockAreaWidget.cpp @@ -820,7 +820,7 @@ void CDockAreaWidget::updateTitleBarVisibility() d->TitleBar->setVisible(isAutoHide() ? true : !Hidden); // Titlebar must always be visible when auto hidden so it can be dragged auto tabBar = d->TitleBar->tabBar(); tabBar->setVisible(isAutoHide() ? false : !Hidden); // Never show tab bar when auto hidden - d->TitleBar->autoHideTitleLabel()->setVisible(CDockManager::testConfigFlag(CDockManager::AutoHideDockAreaHasTitle) && isAutoHide()); // Always show when auto hidden, never otherwise + d->TitleBar->autoHideTitleLabel()->setVisible(isAutoHide()); // Always show when auto hidden, never otherwise updateTitleBarButtonVisibility(Container->topLevelDockArea() == this); } } diff --git a/src/DockManager.h b/src/DockManager.h index 19ea2a0..74ba44a 100644 --- a/src/DockManager.h +++ b/src/DockManager.h @@ -230,17 +230,15 @@ public: { AutoHideFeatureEnabled = 0x01, DockAreaHasAutoHideButton = 0x02, //!< If the flag is set each dock area has a auto hide menu button - LeftSideBarPrioritizeIconOnly = 0x04, //!< If the flag is set left side bar will prioritize showing icons only over text - RightSideBarPrioritizeIconOnly = 0x08, //!< If the flag is set right side bar will prioritize showing icons only over text - BottomSideBarPrioritizeIconOnly = 0x10,//!< If the flag is set bottom side bar will prioritize showing icons only over text - TopSideBarPrioritizeIconOnly = 0x20, //!< If the flag is set top side bar will prioritize showing icons only over text - AutoHideDockAreaHasTitle = 0x40, //!< If the flag is set overlay dock area title bar will show the window title - AutoHideButtonTogglesArea = 0x80, //!< 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 + LeftSideBarIconOnly = 0x04, //!< If the flag is set left side bar will show only icon if a the dock widget has an icon assigned + RightSideBarIconOnly = 0x08, //!< If the flag is set right side bar will show only icon if a the dock widget has an icon assigned + BottomSideBarIconOnly = 0x10,//!< If the flag is set bottom side show only icon if a the dock widget has an icon assigned + TopSideBarIconOnly = 0x20, //!< If the flag is set top side bar show only icon if a the dock widget has an icon assigned + AutoHideButtonTogglesArea = 0x40, //!< 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 AutoHideButtonCheckable = 0x80, //!< If the flag is set, the auto hide button will be checked and unchecked depending on the auto hide state. Mainly for styling purposes. DefaultAutoHideConfig = AutoHideFeatureEnabled - | DockAreaHasAutoHideButton - | AutoHideDockAreaHasTitle, ///< the default configuration for left and right side bars + | DockAreaHasAutoHideButton ///< the default configuration for left and right side bars }; Q_DECLARE_FLAGS(AutoHideFlags, eAutoHideFlag) diff --git a/src/DockWidgetSideTab.cpp b/src/DockWidgetSideTab.cpp index 19cae32..bfc59b1 100644 --- a/src/DockWidgetSideTab.cpp +++ b/src/DockWidgetSideTab.cpp @@ -151,29 +151,30 @@ void CDockWidgetSideTab::updateOrientationForArea(SideBarLocation area) return; } - if (CDockManager::testConfigFlag(CDockManager::LeftSideBarPrioritizeIconOnly) && area == Left) + bool IconOnly = false; + switch (area) { - setText(""); - setOrientation(Qt::Horizontal); - return; + case SideBarLocation::Left: + IconOnly = CDockManager::testConfigFlag(CDockManager::LeftSideBarIconOnly); + break; + + case SideBarLocation::Right: + IconOnly = CDockManager::testConfigFlag(CDockManager::RightSideBarIconOnly); + break; + + case SideBarLocation::Top: + IconOnly = CDockManager::testConfigFlag(CDockManager::BottomSideBarIconOnly); + break; + + case SideBarLocation::Bottom: + IconOnly = CDockManager::testConfigFlag(CDockManager::TopSideBarIconOnly); + break; } - if (CDockManager::testConfigFlag(CDockManager::RightSideBarPrioritizeIconOnly) && area == Right) + + if (IconOnly) { setText(""); setOrientation(Qt::Horizontal); - return; - } - if (CDockManager::testConfigFlag(CDockManager::BottomSideBarPrioritizeIconOnly) && area == Bottom) - { - setText(""); - setOrientation(Qt::Horizontal); - return; - } - if (CDockManager::testConfigFlag(CDockManager::TopSideBarPrioritizeIconOnly) && area == Top) - { - setText(""); - setOrientation(Qt::Horizontal); - return; } } diff --git a/src/stylesheets/focus_highlighting.css b/src/stylesheets/focus_highlighting.css index d559716..34ece19 100644 --- a/src/stylesheets/focus_highlighting.css +++ b/src/stylesheets/focus_highlighting.css @@ -35,6 +35,39 @@ ads--CDockAreaWidget { } +ads--CDockAreaTitleBar { + background: transparent; + border-bottom: 2px solid palette(light); + padding-bottom: 0px; +} + +ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar { + border-bottom: 2px solid palette(highlight); +} + +ads--CTitleBarButton { + padding: 0px 0px; +} + + +#tabsMenuButton::menu-indicator { + image: none; +} + + +#dockAreaCloseButton { + qproperty-icon: url(:/ads/images/close-button.svg), + url(:/ads/images/close-button-disabled.svg) disabled; + qproperty-iconSize: 16px; +} + +#detachGroupButton { + qproperty-icon: url(:/ads/images/detach-button.svg), + url(:/ads/images/detach-button-disabled.svg) disabled; + qproperty-iconSize: 16px; +} + + /***************************************************************************** * CDockWidgetTab @@ -63,28 +96,6 @@ ads--CDockWidgetTab[activeTab="true"] QLabel { } - -/***************************************************************************** - * CDockWidget - *****************************************************************************/ -ads--CDockWidget { - background: palette(light); - border-color: palette(light); - border-style: solid; - border-width: 1px 0 0 0; -} - - -QScrollArea#dockWidgetScrollArea { - padding: 0px; - border: none; -} - - - -/***************************************************************************** - * Dock widget tab styling - *****************************************************************************/ #tabCloseButton { margin-top: 2px; background: none; @@ -129,38 +140,19 @@ ads--CDockWidgetTab[focused="true"] QLabel { /***************************************************************************** - * Dock area title bar and buttons styling + * CDockWidget *****************************************************************************/ - ads--CDockAreaTitleBar { - background: transparent; - border-bottom: 2px solid palette(light); - padding-bottom: 0px; -} - -ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar { - border-bottom: 2px solid palette(highlight); -} - -ads--CTitleBarButton { - padding: 0px 0px; +ads--CDockWidget { + background: palette(light); + border-color: palette(light); + border-style: solid; + border-width: 1px 0 0 0; } -#tabsMenuButton::menu-indicator { - image: none; -} - - -#dockAreaCloseButton { - qproperty-icon: url(:/ads/images/close-button.svg), - url(:/ads/images/close-button-disabled.svg) disabled; - qproperty-iconSize: 16px; -} - -#detachGroupButton { - qproperty-icon: url(:/ads/images/detach-button.svg), - url(:/ads/images/detach-button-disabled.svg) disabled; - qproperty-iconSize: 16px; +QScrollArea#dockWidgetScrollArea { + padding: 0px; + border: none; }