From 8e8ead0b4f5c62557cc17c14f91534a67e501c89 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Tue, 25 Oct 2022 09:11:10 +0200 Subject: [PATCH] Improved visual_studio_light.css --- demo/main.cpp | 12 +- examples/hideshow/MainWindow.cpp | 2 + src/DockManager.cpp | 5 +- src/stylesheets/default.css | 10 +- src/stylesheets/visual_studio_light.css | 241 ++++++++++++++++++++++++ 5 files changed, 257 insertions(+), 13 deletions(-) create mode 100644 src/stylesheets/visual_studio_light.css diff --git a/demo/main.cpp b/demo/main.cpp index a948786..2b7e636 100644 --- a/demo/main.cpp +++ b/demo/main.cpp @@ -46,16 +46,16 @@ int main(int argc, char *argv[]) a.setApplicationName("Advanced Docking System Demo"); a.setQuitOnLastWindowClosed(true); - QFile StyleSheetFile(":/adsdemo/app.css"); - StyleSheetFile.open(QIODevice::ReadOnly); - QTextStream StyleSheetStream(&StyleSheetFile); - a.setStyleSheet(StyleSheetStream.readAll()); - StyleSheetFile.close(); - qInstallMessageHandler(myMessageOutput); qDebug() << "Message handler test"; CMainWindow mw; mw.show(); + + QFile StyleSheetFile(":/adsdemo/app.css"); + StyleSheetFile.open(QIODevice::ReadOnly); + QTextStream StyleSheetStream(&StyleSheetFile); + a.setStyleSheet(StyleSheetStream.readAll()); + StyleSheetFile.close(); return a.exec(); } diff --git a/examples/hideshow/MainWindow.cpp b/examples/hideshow/MainWindow.cpp index e4d7449..44ce672 100644 --- a/examples/hideshow/MainWindow.cpp +++ b/examples/hideshow/MainWindow.cpp @@ -5,6 +5,8 @@ #include #include +using namespace ads; + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) diff --git a/src/DockManager.cpp b/src/DockManager.cpp index c61c426..1f7e1f9 100644 --- a/src/DockManager.cpp +++ b/src/DockManager.cpp @@ -191,8 +191,9 @@ void DockManagerPrivate::loadStylesheet() initResource(); QString Result; QString FileName = ":ads/stylesheets/"; - FileName += CDockManager::testConfigFlag(CDockManager::FocusHighlighting) - ? "visual_studio_light" : "default"; + FileName += "visual_studio_light"; + /*FileName += CDockManager::testConfigFlag(CDockManager::FocusHighlighting) + ? "focus_highlighting" : "default";*/ #ifdef Q_OS_LINUX FileName += "_linux"; #endif diff --git a/src/stylesheets/default.css b/src/stylesheets/default.css index 9dbf789..d18a203 100644 --- a/src/stylesheets/default.css +++ b/src/stylesheets/default.css @@ -57,11 +57,6 @@ QScrollArea#dockWidgetScrollArea { border: none; } -#dockAreaAutoHideButton { - qproperty-icon: url(:/ads/images/vs-pin-button.svg); - qproperty-iconSize: 16px; -} - #tabCloseButton { margin-top: 2px; @@ -188,6 +183,11 @@ ads--CAutoHideDockContainer::handle:horizontal { }*/ +#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.svg); diff --git a/src/stylesheets/visual_studio_light.css b/src/stylesheets/visual_studio_light.css new file mode 100644 index 0000000..f6b2f46 --- /dev/null +++ b/src/stylesheets/visual_studio_light.css @@ -0,0 +1,241 @@ + +/* + * Default style sheet on Windows Platforms with focus highlighting flag enabled + */ +ads--CDockManager { + padding: 6px; + background: palette(window); +} + + +ads--CDockContainerWidget { + background: palette(window); +} + + +/*ads--CDockContainerWidget > QSplitter{ + padding: 1 0 1 0; +}*/ + +ads--CDockAreaWidget { + background: palette(window); + /*border: 1px solid palette(dark);*/ +} + + +ads--CDockWidgetTab { + background: palette(window); + border: none; + padding: 0 0px; + qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/ +} + +ads--CDockWidgetTab[activeTab="true"] { + background: rgb(204, 204, 204); +} + +ads--CDockWidgetTab QLabel { + color: palette(foreground); +} + +ads--CDockWidgetTab[activeTab="true"] QLabel { + color: palette(foreground); +} + +ads--CDockWidget { + background: palette(light); + /*border-color: palette(dark); + border-style: solid; + border-width: 1px 0 0 0;*/ + border: 1px solid rgb(204, 204, 204); + border-top: none; +} + +ads--CTitleBarButton { + padding: 0px 0px; +} + +QScrollArea#dockWidgetScrollArea { + padding: 0px; + border: none; +} + +#tabsMenuButton::menu-indicator { + image: none; +} + +#tabCloseButton { + margin-top: 2px; + background: none; + border: none; + padding: 0px -2px; + qproperty-icon: url(:/ads/images/close-button.svg), + url(:/ads/images/close-button-disabled.svg) disabled; + qproperty-iconSize: 16px; +} + +#tabCloseButton:hover { + /*border: 1px solid rgba(0, 0, 0, 32);*/ + background: rgba(0, 0, 0, 24); +} + +#tabCloseButton:pressed { + background: rgba(0, 0, 0, 48); +} + +#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; +} + +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; */ +} + +/* Focus related styling */ +ads--CDockWidgetTab[focused="true"] { + background: palette(highlight); + border-color: palette(highlight); +} + +ads--CDockWidgetTab[focused="true"]>#tabCloseButton { + qproperty-icon: url(:/ads/images/close-button-focused.svg) +} + +ads--CDockWidgetTab[focused="true"]>#tabCloseButton:hover { + background: rgba(255, 255, 255, 48); +} + +ads--CDockWidgetTab[focused="true"]>#tabCloseButton:pressed { + background: rgba(255, 255, 255, 92); +} + +ads--CDockWidgetTab[focused="true"] QLabel { + color: palette(light); +} + +ads--CDockAreaTitleBar { + background: transparent; + border-bottom: 2px solid rgb(204, 204, 204); + padding-bottom: 0px; +} + +ads--CDockAreaWidget[focused="true"] ads--CDockAreaTitleBar { + background: transparent; + border-bottom: 2px solid palette(highlight); + padding-bottom: 0px; +} + +/*----------------------------------------------------------------------------- + * Styling of auto hide functionality + *---------------------------------------------------------------------------- + */ +ads--CDockWidgetSideTab { + /*background: palette(window);*/ + qproperty-iconSize: 16px 16px;/* this is optional in case you would like to change icon size*/ +} + +ads--CDockWidgetSideTab[sideTabBarArea="0"] { + /*border-right: 1px solid white;*/ +} + + +ads--CDockWidgetSideTab[sideTabBarArea="1"] { + /*border-bottom: 1px solid white;*/ +} + +ads--CDockWidgetSideTab[sideTabBarArea="2"] { + border-bottom: 1px solid white; +} + +ads--CDockWidgetSideTab[sideTabBarArea="3"] { + border-right: 1px solid white; +} + +ads--CDockWidgetSideTab:hover[sideTabBarArea="0"] { + +} + +ads--CDockWidgetSideTab:hover[sideTabBarArea="1"] { + +} + +ads--CDockWidgetSideTab:hover[sideTabBarArea="2"] { + +} + +ads--CDockWidgetSideTab:hover[sideTabBarArea="3"] { + +} + +ads--CDockWidgetSideTab:hover[sideTabBarArea="0"][activeTab="true"] { + +} + +ads--CDockWidgetSideTab[sideTabBarArea="0"][activeTab="true"] { + +} + +ads--CDockWidgetSideTab[sideTabBarArea="1"][activeTab="true"] { + +} + +ads--CDockWidgetSideTab[sideTabBarArea="2"][activeTab="true"] { + +} + +ads--CDockWidgetSideTab[sideTabBarArea="3"][activeTab="true"] { + +} + +/* +ads--CAutoHideDockContainer::handle { + background: palette(dark); +} + +ads--CAutoHideDockContainer::handle:vertical { + height: 4px; +} + + +ads--CAutoHideDockContainer::handle:horizontal { + width: 4px; +} +*/ + +/*ads--CAutoHideDockContainer[sideTabBarArea="0"]:handle { + border: 1px solid palette(dark); + background: white; +}*/ + + +#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.svg); + qproperty-iconSize: 16px; +} + +#autoHideTitleLabel { + padding-left: 4px; +} + +ads--CResizeHandle +{ + background: red; + border: 1px solid green; +}