Added option to auto hide a DockWidget or a DockArea to a specific sidebar location

This commit is contained in:
Uwe Kindler
2022-11-03 15:28:01 +01:00
parent 1922395b4b
commit 04ea1c68a7
14 changed files with 161 additions and 80 deletions

View File

@@ -1157,7 +1157,7 @@ void CDockWidget::raise()
//============================================================================
void CDockWidget::setAutoHide(bool Enable)
void CDockWidget::setAutoHide(bool Enable, SideBarLocation Location)
{
if (!CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
@@ -1177,21 +1177,21 @@ void CDockWidget::setAutoHide(bool Enable)
}
else
{
auto area = DockArea->calculateSideTabBarArea();
auto area = (SideBarNone == Location) ? DockArea->calculateSideTabBarArea() : Location;
dockContainer()->createAndSetupAutoHideContainer(area, this);
}
}
//============================================================================
void CDockWidget::toggleAutoHide()
void CDockWidget::toggleAutoHide(SideBarLocation Location)
{
if (!CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
return;
}
setAutoHide(!isAutoHide());
setAutoHide(!isAutoHide(), Location);
}