new configuration of icon only tabs

This commit is contained in:
nitramr 2023-12-02 14:48:43 +01:00
parent 5d6831d179
commit 818e568f4a
2 changed files with 9 additions and 0 deletions

View File

@ -214,6 +214,7 @@ public:
//! Users can overwrite this by setting the environment variable ADS_UseNativeTitle to "1" or "0". //! Users can overwrite this by setting the environment variable ADS_UseNativeTitle to "1" or "0".
MiddleMouseButtonClosesTab = 0x2000000, //! If the flag is set, the user can use the mouse middle button to close the tab under the mouse MiddleMouseButtonClosesTab = 0x2000000, //! If the flag is set, the user can use the mouse middle button to close the tab under the mouse
DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs DisableTabTextEliding = 0x4000000, //! Set this flag to disable eliding of tab texts in dock area tabs
ShowTabTextOnlyForActiveTab =0x8000000, //! Set this flag to show label texts in dock area tabs only for active tabs
DefaultDockAreaButtons = DockAreaHasCloseButton DefaultDockAreaButtons = DockAreaHasCloseButton
| DockAreaHasUndockButton | DockAreaHasUndockButton

View File

@ -581,6 +581,14 @@ void CDockWidgetTab::setActiveTab(bool active)
{ {
d->updateCloseButtonVisibility(active); d->updateCloseButtonVisibility(active);
if(CDockManager::testConfigFlag(CDockManager::ShowTabTextOnlyForActiveTab) && !d->Icon.isNull())
{
if(active)
d->TitleLabel->setVisible(true);
else
d->TitleLabel->setVisible(false);
}
// Focus related stuff // Focus related stuff
if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting) && !d->DockWidget->dockManager()->isRestoringState()) if (CDockManager::testConfigFlag(CDockManager::FocusHighlighting) && !d->DockWidget->dockManager()->isRestoringState())
{ {