From 62ce9dca5d5b702fe704dce372f8ad3b7291749e Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Thu, 7 May 2020 14:20:31 +0200 Subject: [PATCH] Fixed small bug in FloatingDragPreview that caused flashing of hidden overlay when dragging the last visible dock widget in non opaque docking mode --- src/FloatingDragPreview.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/FloatingDragPreview.cpp b/src/FloatingDragPreview.cpp index 3d3cc10..cd2e534 100644 --- a/src/FloatingDragPreview.cpp +++ b/src/FloatingDragPreview.cpp @@ -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;