From ea8e4421535a60b846413b3f675f1c28aef95ce7 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Wed, 26 Oct 2022 15:36:17 +0200 Subject: [PATCH] Updated default.css to support the new auto hide functionality --- src/AutoHideDockContainer.cpp | 2 - src/stylesheets/default.css | 229 ++++++++++++++++++++++++- src/stylesheets/focus_highlighting.css | 23 +-- 3 files changed, 235 insertions(+), 19 deletions(-) diff --git a/src/AutoHideDockContainer.cpp b/src/AutoHideDockContainer.cpp index de41960..80698f2 100644 --- a/src/AutoHideDockContainer.cpp +++ b/src/AutoHideDockContainer.cpp @@ -500,12 +500,10 @@ bool CAutoHideDockContainer::eventFilter(QObject* watched, QEvent* event) //============================================================================ void CAutoHideDockContainer::resizeEvent(QResizeEvent* event) { - std::cout << "ResizeEvent" << std::endl; Super::resizeEvent(event); if (d->ResizeHandle->isResizing()) { d->Size = this->size(); - qDebug() << "Size " << d->Size; d->updateResizeHandleSizeLimitMax(); } } diff --git a/src/stylesheets/default.css b/src/stylesheets/default.css index 7952bd1..fd431b1 100644 --- a/src/stylesheets/default.css +++ b/src/stylesheets/default.css @@ -1,22 +1,39 @@ /* * Default style sheet on Windows Platforms */ + +/***************************************************************************** + * CDockContainerWidget + *****************************************************************************/ ads--CDockContainerWidget { - background: palette(dark); + background: palette(window); } -ads--CDockContainerWidget > QSplitter{ - padding: 1 0 1 0; + + +/***************************************************************************** + * CDockSplitter + *****************************************************************************/ +ads--CDockContainerWidget > QSplitter { + padding: 1 0 1 0; } ads--CDockContainerWidget ads--CDockSplitter::handle { background: palette(dark); } + +/***************************************************************************** + * CDockAreaWidget + *****************************************************************************/ ads--CDockAreaWidget { background: palette(window); - border: 1px solid white; } + + +/***************************************************************************** + * CDockWidgetTab + *****************************************************************************/ ads--CDockWidgetTab { background: palette(window); border-color: palette(light); @@ -39,6 +56,10 @@ ads--CDockWidgetTab[activeTab="true"] QLabel { color: palette(foreground); } + +/***************************************************************************** + * CDockWidget + *****************************************************************************/ ads--CDockWidget { background: palette(light); border-color: palette(light); @@ -46,15 +67,16 @@ ads--CDockWidget { border-width: 1px 0 0 0; } -ads--CTitleBarButton { - padding: 0px 0px; -} QScrollArea#dockWidgetScrollArea { padding: 0px; border: none; } + +/***************************************************************************** + * Dock widget tab styling + *****************************************************************************/ #tabCloseButton { margin-top: 2px; background: none; @@ -74,6 +96,16 @@ QScrollArea#dockWidgetScrollArea { background: rgba(0, 0, 0, 32); } + + +/***************************************************************************** + * Dock area title bar and buttons styling + *****************************************************************************/ + ads--CTitleBarButton { + padding: 0px 0px; +} + + #tabsMenuButton::menu-indicator { image: none; } @@ -94,3 +126,186 @@ QScrollArea#dockWidgetScrollArea { url(:/ads/images/detach-button-disabled.svg) disabled; qproperty-iconSize: 16px; } + + +/***************************************************************************** + * + * Styling of auto hide functionality + * + *****************************************************************************/ + + +/***************************************************************************** + * CDockWidgetSideTab + *****************************************************************************/ +ads--CDockWidgetSideTab { + /*background: palette(window);*/ + qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/ +} + + +ads--CDockWidgetSideTab { + background: none; + border: none; + padding-left: 2px; + padding-right: 0px; + text-align: center; +} + + +ads--CDockWidgetSideTab[sideTabBarArea="0"], +ads--CDockWidgetSideTab[sideTabBarArea="2"] { + border-top: 5px solid rgba(0, 0, 0, 48); + margin-right: 6px; + min-height: 20; +} + + +ads--CDockWidgetSideTab[sideTabBarArea="1"], +ads--CDockWidgetSideTab[sideTabBarArea="3"] { + border-bottom: 5px solid rgba(0, 0, 0, 48); + margin-right: 6px; + min-height: 20; +} + + + +ads--CDockWidgetSideTab:hover[sideTabBarArea="0"], +ads--CDockWidgetSideTab:hover[sideTabBarArea="2"] { + border-top: 5px solid palette(highlight); + color: palette(highlight); +} + + +ads--CDockWidgetSideTab:hover[sideTabBarArea="1"], +ads--CDockWidgetSideTab:hover[sideTabBarArea="3"] { + border-bottom: 5px solid palette(highlight); + color: palette(highlight); +} + +ads--CDockWidgetSideTab[sideTabBarArea="0"][activeTab="true"], +ads--CDockWidgetSideTab[sideTabBarArea="2"][activeTab="true"] { + border-top: 5px solid palette(highlight); +} + + +ads--CDockWidgetSideTab[sideTabBarArea="1"][activeTab="true"], +ads--CDockWidgetSideTab[sideTabBarArea="3"][activeTab="true"] { + border-bottom: 5px solid palette(highlight); +} + + +/***************************************************************************** + * CSideTabBar + *****************************************************************************/ +ads--CSideTabBar{ + background: palette(window); +} + + +ads--CSideTabBar[sideTabBarArea="0"] { + border-bottom: 1px solid palette(dark); +} + +ads--CSideTabBar[sideTabBarArea="1"] { + border-right: 1px solid palette(dark); +} + +ads--CSideTabBar[sideTabBarArea="2"] { + border-left: 1px solid palette(dark); +} + +ads--CSideTabBar[sideTabBarArea="3"] { + border-top: 1px solid palette(dark); +} + + +/***************************************************************************** + * CAutoHideDockContainer + *****************************************************************************/ +ads--CAutoHideDockContainer { + background: palette(window); +} + + +ads--CAutoHideDockContainer ads--CDockAreaTitleBar { + background: palette(highlight); + padding: 0px; + border: none; +} + + +/* + * This is required because the ads--CDockAreaWidget[focused="true"] will + * overwrite the ads--CAutoHideDockContainer ads--CDockAreaTitleBar rule + */ +ads--CAutoHideDockContainer ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar { + background: palette(highlight); + padding: 0px; + border: none; +} + + +#autoHideTitleLabel { + padding-left: 4px; + color: palette(light); +} + + +/***************************************************************************** + * CAutoHideDockContainer titlebar buttons + *****************************************************************************/ +#dockAreaAutoHideButton { + qproperty-icon: url(:/ads/images/vs-pin-button.svg); + qproperty-iconSize: 16px; +} + +ads--CAutoHideDockContainer #dockAreaAutoHideButton { + qproperty-icon: url(:/ads/images/vs-pin-button-pinned-focused.svg); + qproperty-iconSize: 16px; +} + + +ads--CAutoHideDockContainer #dockAreaCloseButton{ + qproperty-icon: url(:/ads/images/close-button-focused.svg) +} + + +ads--CAutoHideDockContainer ads--CTitleBarButton:hover { + background: rgba(255, 255, 255, 48); +} + +ads--CAutoHideDockContainer ads--CTitleBarButton:pressed { + background: rgba(255, 255, 255, 96); +} + +/***************************************************************************** + * CAutoHideDockContainer Titlebar and Buttons + *****************************************************************************/ + + +/***************************************************************************** + * CResizeHandle + *****************************************************************************/ +ads--CResizeHandle { + background: palette(window); +} + + +ads--CAutoHideDockContainer[sideTabBarArea="0"] ads--CResizeHandle { + border-top: 1px solid palette(dark); +} + +ads--CAutoHideDockContainer[sideTabBarArea="1"] ads--CResizeHandle { + border-left: 1px solid palette(dark); +} + +ads--CAutoHideDockContainer[sideTabBarArea="2"] ads--CResizeHandle { + border-right: 1px solid palette(dark); +} + +ads--CAutoHideDockContainer[sideTabBarArea="3"] ads--CResizeHandle { + border-top: 1px solid palette(dark); +} + + diff --git a/src/stylesheets/focus_highlighting.css b/src/stylesheets/focus_highlighting.css index 9bf052c..d559716 100644 --- a/src/stylesheets/focus_highlighting.css +++ b/src/stylesheets/focus_highlighting.css @@ -10,18 +10,28 @@ ads--CDockContainerWidget { background: palette(window); } -ads--CDockContainerWidget > QSplitter{ - padding: 1 0 1 0; + +/***************************************************************************** + * CDockSplitter + *****************************************************************************/ +ads--CDockContainerWidget > QSplitter { + padding: 1 0 1 0; } +ads--CDockSplitter::handle { + background-color: palette(dark); + /* uncomment the following line if you would like to change the size of + the splitter handles */ + /* height: 1px; */ +} + /***************************************************************************** * CDockAreaWidget *****************************************************************************/ ads--CDockAreaWidget { background: palette(window); - /*border: 1px solid white;*/ } @@ -153,13 +163,6 @@ ads--CTitleBarButton { qproperty-iconSize: 16px; } -ads--CDockSplitter::handle { - background-color: palette(dark); - /* uncomment the following line if you would like to change the size of - the splitter handles */ - /* height: 1px; */ -} - /*****************************************************************************