Floating window fixes. (#239)

* Don't show a CFloatingDockContainer if all its CDockWidget were hidden before its first shown.

* Destroy empty CFloatingDockContainer when removing CDockWidget via removeDockWidget function.
This commit is contained in:
shelomentsev 2020-08-20 15:58:15 +05:00 committed by GitHub
parent 8361f90dce
commit a4d281dbb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 1 deletions

View File

@ -478,6 +478,14 @@ void CDockAreaWidget::removeDockWidget(CDockWidget* DockWidget)
ADS_PRINT("Dock Area empty");
DockContainer->removeDockArea(this);
this->deleteLater();
if(DockContainer->dockAreaCount() == 0)
{
if(CFloatingDockContainer* FloatingDockContainer = DockContainer->floatingWidget())
{
FloatingDockContainer->hide();
FloatingDockContainer->deleteLater();
}
}
}
else if (DockWidget == CurrentDockWidget)
{

View File

@ -653,7 +653,14 @@ void CDockManager::showEvent(QShowEvent *event)
for (auto FloatingWidget : d->UninitializedFloatingWidgets)
{
FloatingWidget->show();
for(CDockWidget* DockWidget : FloatingWidget->dockWidgets())
{
if(!DockWidget->isClosed())
{
FloatingWidget->show();
break;
}
}
}
d->UninitializedFloatingWidgets.clear();
}