mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
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:
parent
985d164cd1
commit
62ce9dca5d
@ -123,7 +123,19 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
|
|||||||
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
|
int VisibleDockAreas = TopContainer->visibleDockAreaCount();
|
||||||
ContainerOverlay->setAllowedAreas(
|
ContainerOverlay->setAllowedAreas(
|
||||||
VisibleDockAreas > 1 ? OuterDockAreas : AllDockAreas);
|
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);
|
ContainerOverlay->enableDropPreview(ContainerArea != InvalidDockWidgetArea);
|
||||||
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)
|
||||||
@ -151,14 +163,6 @@ void FloatingDragPreviewPrivate::updateDropOverlays(const QPoint &GlobalPos)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
DockAreaOverlay->hideOverlay();
|
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)
|
if (DockArea == ContentSourceArea && InvalidDockWidgetArea == ContainerDropArea)
|
||||||
{
|
{
|
||||||
DropContainer = nullptr;
|
DropContainer = nullptr;
|
||||||
|
Loading…
Reference in New Issue
Block a user