diff --git a/examples/autohide/CMakeLists.txt b/examples/autohide/CMakeLists.txt index 3379067..58aba1f 100644 --- a/examples/autohide/CMakeLists.txt +++ b/examples/autohide/CMakeLists.txt @@ -7,6 +7,7 @@ add_executable(AutoHideExample WIN32 main.cpp mainwindow.cpp mainwindow.ui + autohide.qrc ) target_include_directories(AutoHideExample PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/../../src") target_link_libraries(AutoHideExample PRIVATE qt${QT_VERSION_MAJOR}advanceddocking) diff --git a/examples/autohide/autohide.pro b/examples/autohide/autohide.pro index 8a00c62..d20d00b 100644 --- a/examples/autohide/autohide.pro +++ b/examples/autohide/autohide.pro @@ -27,6 +27,9 @@ HEADERS += \ FORMS += \ mainwindow.ui +RESOURCES += \ + autohide.qrc + LIBS += -L$${ADS_OUT_ROOT}/lib include(../../ads.pri) INCLUDEPATH += ../../src diff --git a/examples/autohide/autohide.qrc b/examples/autohide/autohide.qrc new file mode 100644 index 0000000..0c68187 --- /dev/null +++ b/examples/autohide/autohide.qrc @@ -0,0 +1,5 @@ + + + images/minimize-button.svg + + diff --git a/examples/autohide/images/minimize-button.svg b/examples/autohide/images/minimize-button.svg new file mode 100644 index 0000000..90c3197 --- /dev/null +++ b/examples/autohide/images/minimize-button.svg @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + Jemis Mali + + + + + image/svg+xml + + + + + + diff --git a/examples/autohide/mainwindow.cpp b/examples/autohide/mainwindow.cpp index d70b51c..b514818 100644 --- a/examples/autohide/mainwindow.cpp +++ b/examples/autohide/mainwindow.cpp @@ -14,7 +14,7 @@ #include "AutoHideDockContainer.h" #include "DockAreaWidget.h" -#include "DockAreaTitleBar.h" +#include "IconProvider.h" using namespace ads; @@ -28,6 +28,10 @@ CMainWindow::CMainWindow(QWidget *parent) CDockManager::setConfigFlag(CDockManager::XmlCompressionEnabled, false); CDockManager::setConfigFlag(CDockManager::FocusHighlighting, true); CDockManager::setAutoHideConfigFlags(CDockManager::DefaultAutoHideConfig); + CDockManager::setAutoHideConfigFlag(CDockManager::AutoHideCloseButtonCollapsesDock, true); + CDockManager::iconProvider().registerCustomIcon(AutoHideDockAreaCloseIcon, + QIcon(":/adsautohide/images/minimize-button.svg")); + DockManager = new CDockManager(this); // Set central widget diff --git a/src/stylesheets/focus_highlighting.css b/src/stylesheets/focus_highlighting.css index 0fd9f18..924506f 100644 --- a/src/stylesheets/focus_highlighting.css +++ b/src/stylesheets/focus_highlighting.css @@ -56,8 +56,6 @@ ads--CTitleBarButton { #dockAreaCloseButton { - qproperty-icon: url(:/ads/images/close-button.svg), - url(:/ads/images/close-button-disabled.svg) disabled; qproperty-iconSize: 16px; } @@ -337,7 +335,6 @@ ads--CAutoHideDockContainer #dockAreaAutoHideButton { ads--CAutoHideDockContainer #dockAreaCloseButton{ - qproperty-icon: url(:/ads/images/close-button-focused.svg) }