Added setAutoHide() and toggleAutoHide() function to CDockWidget

This commit is contained in:
Uwe Kindler
2022-11-02 08:27:23 +01:00
parent 7c1d04f7be
commit 9c14c62637
3 changed files with 53 additions and 8 deletions

View File

@@ -1156,6 +1156,45 @@ void CDockWidget::raise()
}
//============================================================================
void CDockWidget::setAutoHide(bool Enable)
{
if (!CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
return;
}
// Do nothing if nothing changes
if (Enable == isAutoHide())
{
return;
}
auto DockArea = dockAreaWidget();
if (!Enable)
{
DockArea->setAutoHide(false);
}
else
{
auto area = DockArea->calculateSideTabBarArea();
dockContainer()->createAndSetupAutoHideContainer(area, this);
}
}
//============================================================================
void CDockWidget::toggleAutoHide()
{
if (!CDockManager::testAutoHideConfigFlag(CDockManager::AutoHideFeatureEnabled))
{
return;
}
setAutoHide(!isAutoHide());
}
} // namespace ads
//---------------------------------------------------------------------------