From 3cd12ce1d3bc24d3f154a6d40cc8b513ace49c17 Mon Sep 17 00:00:00 2001 From: Uwe Kindler Date: Wed, 27 Nov 2019 14:44:17 +0100 Subject: [PATCH] Fixed creation a FloatingDockContainer --- src/FloatingOverlay.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/FloatingOverlay.cpp b/src/FloatingOverlay.cpp index 134195a..e34f674 100644 --- a/src/FloatingOverlay.cpp +++ b/src/FloatingOverlay.cpp @@ -243,10 +243,12 @@ bool CFloatingOverlay::eventFilter(QObject *watched, QEvent *event) ADS_PRINT("FloatingWidget::eventFilter QEvent::MouseButtonRelease"); std::cout << "CFloatingOverlay::eventFilter QEvent::MouseButtonRelease" << std::endl; - if (d->DropContainer) + auto DockDropArea = d->DockManager->dockAreaOverlay()->dropAreaUnderCursor(); + auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor(); + bool DropPossible = (DockDropArea != InvalidDockWidgetArea) || (ContainerDropArea != InvalidDockWidgetArea); + if (d->DropContainer && DropPossible) { d->DropContainer->dropWidget(d->Content, QCursor::pos()); - d->DropContainer = nullptr; } else { @@ -263,6 +265,11 @@ bool CFloatingOverlay::eventFilter(QObject *watched, QEvent *event) } FloatingWidget->setGeometry(this->geometry()); FloatingWidget->show(); + QApplication::processEvents(); + int FrameHeight = FloatingWidget->frameGeometry().height() - FloatingWidget->geometry().height(); + QRect FixedGeometry = this->geometry(); + FixedGeometry.adjust(0, FrameHeight, 0, 0); + FloatingWidget->setGeometry(FixedGeometry); } this->close();