mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-04-01 02:42:39 +08:00
Always show TitleBar if it contains any explicit actions
This commit is contained in:
parent
ec018a4c70
commit
1d4b52c498
@ -854,10 +854,22 @@ void CDockAreaWidget::updateTitleBarVisibility()
|
|||||||
bool IsAutoHide = isAutoHide();
|
bool IsAutoHide = isAutoHide();
|
||||||
if (!CDockManager::testConfigFlag(CDockManager::AlwaysShowTabs))
|
if (!CDockManager::testConfigFlag(CDockManager::AlwaysShowTabs))
|
||||||
{
|
{
|
||||||
bool Hidden = Container->hasTopLevelDockWidget() && (Container->isFloating()
|
bool Hidden = false;
|
||||||
|| CDockManager::testConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar));
|
if (!IsAutoHide) // Titlebar must always be visible when auto hidden so it can be dragged
|
||||||
Hidden |= (d->Flags.testFlag(HideSingleWidgetTitleBar) && openDockWidgetsCount() == 1);
|
{
|
||||||
Hidden &= !IsAutoHide; // Titlebar must always be visible when auto hidden so it can be dragged
|
if (Container->isFloating() || CDockManager::testConfigFlag(CDockManager::HideSingleCentralWidgetTitleBar))
|
||||||
|
{
|
||||||
|
// Always show title bar if it contains title bar actions
|
||||||
|
if (CDockWidget* TopLevelWidget = Container->topLevelDockWidget())
|
||||||
|
Hidden |= TopLevelWidget->titleBarActions().empty();
|
||||||
|
}
|
||||||
|
if (!Hidden && d->Flags.testFlag(HideSingleWidgetTitleBar))
|
||||||
|
{
|
||||||
|
// Always show title bar if it contains title bar actions
|
||||||
|
auto DockWidgets = openedDockWidgets();
|
||||||
|
Hidden |= (DockWidgets.size() == 1) && DockWidgets.front()->titleBarActions().empty();
|
||||||
|
}
|
||||||
|
}
|
||||||
d->TitleBar->setVisible(!Hidden);
|
d->TitleBar->setVisible(!Hidden);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user