Properly consider pinnable flag of dock widget when painting the drop overlays - no auto hide overlay for non pinnable dock widgets

This commit is contained in:
Uwe Kindler
2023-07-11 10:28:17 +02:00
parent 364ee33f9c
commit 39bc7f1780
3 changed files with 49 additions and 17 deletions

View File

@@ -590,16 +590,22 @@ void FloatingDockContainerPrivate::updateDropOverlays(const QPoint &GlobalPos)
}
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
DockWidgetAreas AllowedAreas = (VisibleDockAreas > 1) ? OuterDockAreas : AllDockAreas;
DockWidgetAreas AllowedContainerAreas = (VisibleDockAreas > 1) ? OuterDockAreas : AllDockAreas;
auto DockArea = TopContainer->dockAreaAt(GlobalPos);
// If the dock container contains only one single DockArea, then we need
// to respect the allowed areas - only the center area is relevant here because
// all other allowed areas are from the container
if (VisibleDockAreas == 1 && DockArea)
{
AllowedAreas.setFlag(CenterDockWidgetArea, DockArea->allowedAreas().testFlag(CenterDockWidgetArea));
AllowedContainerAreas.setFlag(CenterDockWidgetArea, DockArea->allowedAreas().testFlag(CenterDockWidgetArea));
}
ContainerOverlay->setAllowedAreas(AllowedAreas);
if (DockContainer->features().testFlag(CDockWidget::DockWidgetPinnable))
{
AllowedContainerAreas |= AutoHideDockAreas;
}
ContainerOverlay->setAllowedAreas(AllowedContainerAreas);
DockWidgetArea ContainerArea = ContainerOverlay->showOverlay(TopContainer);
ContainerOverlay->enableDropPreview(ContainerArea != InvalidDockWidgetArea);