Fix bug where dragging an overlayed widget would cause it to be empty

Fix bug where pin and unpin doesn't work
This commit is contained in:
Syarif Fakhri 2022-09-07 15:50:53 +08:00
parent 1d9902b690
commit 302fcd1435
2 changed files with 3 additions and 2 deletions

View File

@ -1045,11 +1045,12 @@ void CDockAreaWidget::onAutoHideToggleRequested(CDockWidget* DockWidget, bool En
if (Enable) if (Enable)
{ {
dockContainer()->createAndInitializeDockWidgetOverlayContainer(area, DockWidget); dockContainer()->createAndInitializeDockWidgetOverlayContainer(area, DockWidget);
toggleView(false); DockWidget->toggleView(false);
} }
else else
{ {
overlayDockContainer()->moveContentsToParent(); overlayDockContainer()->moveContentsToParent();
DockWidget->toggleView(true);
} }
} }

View File

@ -189,7 +189,7 @@ void DockFocusControllerPrivate::updateDockWidgetFocus(CDockWidget* DockWidget)
} }
#endif #endif
if (old && old->overlayDockContainer() && old != DockWidget) if (old && old->overlayDockContainer() && old->overlayDockContainer()->isVisible() && old != FocusedDockWidget)
{ {
old->toggleView(false); old->toggleView(false);
} }