@@ -59,6 +59,7 @@ struct FloatingDockContainerPrivate
59
59
unsigned int zOrderIndex = ++zOrderCounter;
60
60
QPointer<CDockManager> DockManager;
61
61
bool DraggingActive = false ;
62
+ bool NonClientAreaMouseButtonPress = false ;
62
63
QPoint DragStartMousePosition;
63
64
CDockContainerWidget* DropContainer = nullptr ;
64
65
CDockAreaWidget* SingleDockArea = nullptr ;
@@ -92,19 +93,24 @@ void FloatingDockContainerPrivate::titleMouseReleaseEvent()
92
93
return ;
93
94
}
94
95
95
- // Resize the floating widget to the size of the highlighted drop area
96
- // rectangle
97
- QRect Rect = DockManager->containerOverlay ()->dropOverlayRect ();
98
- if (!Rect .isValid ())
96
+ if (DockManager->dockAreaOverlay ()->dropAreaUnderCursor () != InvalidDockWidgetArea
97
+ || DockManager->containerOverlay ()->dropAreaUnderCursor () != InvalidDockWidgetArea)
99
98
{
100
- Rect = DockManager->dockAreaOverlay ()->rect ();
101
- }
99
+ // Resize the floating widget to the size of the highlighted drop area
100
+ // rectangle
101
+ QRect Rect = DockManager->containerOverlay ()->dropOverlayRect ();
102
+ if (!Rect .isValid ())
103
+ {
104
+ Rect = DockManager->dockAreaOverlay ()->rect ();
105
+ }
102
106
103
- if (Rect .isValid ())
104
- {
105
- _this->resize (Rect .size ());
107
+ if (Rect .isValid ())
108
+ {
109
+ _this->resize (Rect .size ());
110
+ }
111
+ DropContainer->dropFloatingWidget (_this, QCursor::pos ());
106
112
}
107
- DropContainer-> dropFloatingWidget (_this, QCursor::pos ());
113
+
108
114
DockManager->containerOverlay ()->hideOverlay ();
109
115
DockManager->dockAreaOverlay ()->hideOverlay ();
110
116
}
@@ -192,6 +198,10 @@ void FloatingDockContainerPrivate::updateDropOverlays(const QPoint& GlobalPos)
192
198
void FloatingDockContainerPrivate::setDraggingActive (bool Active)
193
199
{
194
200
DraggingActive = Active;
201
+ if (!DraggingActive)
202
+ {
203
+ NonClientAreaMouseButtonPress = false ;
204
+ }
195
205
}
196
206
197
207
@@ -331,12 +341,13 @@ void CFloatingDockContainer::showEvent(QShowEvent *event)
331
341
// ============================================================================
332
342
bool CFloatingDockContainer::event (QEvent *e)
333
343
{
334
- if (( e->type () == QEvent::NonClientAreaMouseButtonPress) )
344
+ if (e->type () == QEvent::NonClientAreaMouseButtonPress)
335
345
{
336
346
if (QGuiApplication::mouseButtons () == Qt::LeftButton)
337
347
{
338
348
qDebug () << " FloatingWidget::event Event::NonClientAreaMouseButtonPress" << e->type ();
339
349
d->setDraggingActive (true );
350
+ d->NonClientAreaMouseButtonPress = true ;
340
351
}
341
352
}
342
353
else if (e->type () == QEvent::NonClientAreaMouseButtonDblClick)
@@ -349,6 +360,12 @@ bool CFloatingDockContainer::event(QEvent *e)
349
360
qDebug () << " FloatingWidget::event QEvent::NonClientAreaMouseButtonRelease" ;
350
361
d->titleMouseReleaseEvent ();
351
362
}
363
+ else if (d->NonClientAreaMouseButtonPress && (e->type () == QEvent::Resize))
364
+ {
365
+ // If user resizes the floating widget, we do not want to show any
366
+ // drop overlays or drop overlay icons
367
+ d->setDraggingActive (false );
368
+ }
352
369
353
370
return QWidget::event (e);
354
371
}
0 commit comments