Fixed small bug in FloatingDragPreview that caused flashing of hidden overlay when dragging the last visible dock widget in non opaque docking mode

This commit is contained in:
Uwe Kindler 2020-05-07 14:20:31 +02:00
parent 985d164cd1
commit 62ce9dca5d

View File

@ -123,7 +123,19 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
ContainerOverlay->setAllowedAreas(
VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
DockWidgetArea ContainerArea = ContainerOverlay->showOverlay(TopContainer);
DockWidgetArea ContainerArea = InvalidDockWidgetArea;
// If there is only one single visible dock area in a container, then
// it does not make sense to show a dock overlay because the dock area
// would be removed and inserted at the same position
if (VisibleDockAreas <= 1)
{
ContainerOverlay->hideOverlay();
}
else
{
ContainerArea = ContainerOverlay->showOverlay(TopContainer);
}
ContainerOverlay->enableDropPreview(ContainerArea != InvalidDockWidgetArea);
auto DockArea = TopContainer->dockAreaAt(GlobalPos);
if (DockArea && DockArea->isVisible() && VisibleDockAreas > 0 && DockArea != ContentSourceArea)
@ -151,14 +163,6 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
else
{
DockAreaOverlay->hideOverlay();
// If there is only one single visible dock area in a container, then
// it does not make sense to show a dock overlay because the dock area
// would be removed and inserted at the same position
if (VisibleDockAreas <= 1)
{
ContainerOverlay->hideOverlay();
}
if (DockArea == ContentSourceArea && InvalidDockWidgetArea == ContainerDropArea)
{
DropContainer = nullptr;