Add config to make auto hide button optionally checkable for styling purposes

This commit is contained in:
Syarif Fakhri 2022-10-18 17:21:10 +08:00
parent 118e79e7ec
commit d83ec7c66f
2 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,8 @@ void DockAreaTitleBarPrivate::createButtons()
internal::setToolTip(AutoHideButton, QObject::tr("Toggle Auto Hide"));
internal::setButtonIcon(AutoHideButton, QStyle::SP_DialogOkButton, ads::AutoHideIcon);
AutoHideButton->setSizePolicy(ButtonSizePolicy);
AutoHideButton->setCheckable(testConfigFlag(CDockManager::AutoHideButtonCheckable));
AutoHideButton->setChecked(false);
Layout->addWidget(AutoHideButton, 0);
_this->connect(AutoHideButton, SIGNAL(clicked()), SLOT(onAutoHideButtonClicked()));

View File

@ -233,6 +233,7 @@ public:
TopSideBarPrioritizeIconOnly = 0x10, //!< If the flag is set top side bar will prioritize showing icons only over text
AutoHideDockAreaHasTitle = 0x20, //!< If the flag is set overlay dock area title bar will show the window title
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 = DockAreaHasAutoHideButton
| AutoHideDockAreaHasTitle, ///< the default configuration for left and right side bars