Fix overlayed containers able to drag into the center

of the central widget
This commit is contained in:
Syarif Fakhri 2022-09-13 12:45:26 +08:00
parent dfc2714d3b
commit b950b8a209

View File

@ -121,14 +121,21 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
}
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
ContainerOverlay->setAllowedAreas(
VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
// Include the overlay widget we're dragging as a visible widget
auto dockAreaWidget = qobject_cast<CDockAreaWidget*>(Content);
if (dockAreaWidget && dockAreaWidget->isOverlayed())
{
VisibleDockAreas++;
}
ContainerOverlay->setAllowedAreas( VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
auto DockArea = TopContainer->dockAreaAt(GlobalPos);
if (DockArea && DockArea->isVisible() && VisibleDockAreas >= 0 && DockArea != ContentSourceArea)
{
DockAreaOverlay->enableDropPreview(true);
DockAreaOverlay->setAllowedAreas(
(VisibleDockAreas == 1) ? NoDockWidgetArea : DockArea->allowedAreas());
DockAreaOverlay->setAllowedAreas( (VisibleDockAreas == 1) ? NoDockWidgetArea : DockArea->allowedAreas());
DockWidgetArea Area = DockAreaOverlay->showOverlay(DockArea);
// A CenterDockWidgetArea for the dockAreaOverlay() indicates that