mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-24 05:22:06 +08:00
Fix overlayed containers able to drag into the center
of the central widget
This commit is contained in:
parent
dfc2714d3b
commit
b950b8a209
@ -121,14 +121,21 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
|
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);
|
auto DockArea = TopContainer->dockAreaAt(GlobalPos);
|
||||||
if (DockArea && DockArea->isVisible() && VisibleDockAreas >= 0 && DockArea != ContentSourceArea)
|
if (DockArea && DockArea->isVisible() && VisibleDockAreas >= 0 && DockArea != ContentSourceArea)
|
||||||
{
|
{
|
||||||
DockAreaOverlay->enableDropPreview(true);
|
DockAreaOverlay->enableDropPreview(true);
|
||||||
DockAreaOverlay->setAllowedAreas(
|
DockAreaOverlay->setAllowedAreas( (VisibleDockAreas == 1) ? NoDockWidgetArea : DockArea->allowedAreas());
|
||||||
(VisibleDockAreas == 1) ? NoDockWidgetArea : DockArea->allowedAreas());
|
|
||||||
DockWidgetArea Area = DockAreaOverlay->showOverlay(DockArea);
|
DockWidgetArea Area = DockAreaOverlay->showOverlay(DockArea);
|
||||||
|
|
||||||
// A CenterDockWidgetArea for the dockAreaOverlay() indicates that
|
// A CenterDockWidgetArea for the dockAreaOverlay() indicates that
|
||||||
|
Loading…
Reference in New Issue
Block a user