File tree 1 file changed +30
-2
lines changed
1 file changed +30
-2
lines changed Original file line number Diff line number Diff line change @@ -72,6 +72,26 @@ struct FloatingDragPreviewPrivate
72
72
* outside of any drop area
73
73
*/
74
74
void createFloatingWidget ();
75
+
76
+ /* *
77
+ * Returns true, if the content is floatable
78
+ */
79
+ bool isContentFloatable () const
80
+ {
81
+ CDockWidget* DockWidget = qobject_cast<CDockWidget*>(Content);
82
+ if (DockWidget && DockWidget->features ().testFlag (CDockWidget::DockWidgetFloatable))
83
+ {
84
+ return true ;
85
+ }
86
+
87
+ CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(Content);
88
+ if (DockArea && DockArea->features ().testFlag (CDockWidget::DockWidgetFloatable))
89
+ {
90
+ return true ;
91
+ }
92
+
93
+ return false ;
94
+ }
75
95
};
76
96
// struct LedArrayPanelPrivate
77
97
@@ -328,10 +348,18 @@ void CFloatingDragPreview::finishDragging()
328
348
{
329
349
ADS_PRINT (" CFloatingDragPreview::finishDragging" );
330
350
331
- cleanupAutoHideContainerWidget ();
332
-
333
351
auto DockDropArea = d->DockManager ->dockAreaOverlay ()->visibleDropAreaUnderCursor ();
334
352
auto ContainerDropArea = d->DockManager ->containerOverlay ()->visibleDropAreaUnderCursor ();
353
+ bool ValidDropArea = (DockDropArea != InvalidDockWidgetArea) || (ContainerDropArea != InvalidDockWidgetArea);
354
+ bool FloatingRequested = !d->DropContainer && !ValidDropArea;
355
+
356
+ // Non floatable auto hide widgets should stay in its current auto hide
357
+ // state if they are dragged into a floating window
358
+ if (!FloatingRequested || d->isContentFloatable ())
359
+ {
360
+ cleanupAutoHideContainerWidget ();
361
+ }
362
+
335
363
if (!d->DropContainer )
336
364
{
337
365
d->createFloatingWidget ();
You can’t perform that action at this time.
0 commit comments