mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-11-15 13:15:43 +08:00
Fixed #496 Nonfloatable hidden window disappears on drop in empty area
This commit is contained in:
parent
db16c5f1b5
commit
db3dc80170
@ -72,6 +72,26 @@ struct FloatingDragPreviewPrivate
|
||||
* outside of any drop area
|
||||
*/
|
||||
void createFloatingWidget();
|
||||
|
||||
/**
|
||||
* Returns true, if the content is floatable
|
||||
*/
|
||||
bool isContentFloatable() const
|
||||
{
|
||||
CDockWidget* DockWidget = qobject_cast<CDockWidget*>(Content);
|
||||
if (DockWidget && DockWidget->features().testFlag(CDockWidget::DockWidgetFloatable))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
CDockAreaWidget* DockArea = qobject_cast<CDockAreaWidget*>(Content);
|
||||
if (DockArea && DockArea->features().testFlag(CDockWidget::DockWidgetFloatable))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
};
|
||||
// struct LedArrayPanelPrivate
|
||||
|
||||
@ -328,10 +348,18 @@ void CFloatingDragPreview::finishDragging()
|
||||
{
|
||||
ADS_PRINT("CFloatingDragPreview::finishDragging");
|
||||
|
||||
cleanupAutoHideContainerWidget();
|
||||
|
||||
auto DockDropArea = d->DockManager->dockAreaOverlay()->visibleDropAreaUnderCursor();
|
||||
auto ContainerDropArea = d->DockManager->containerOverlay()->visibleDropAreaUnderCursor();
|
||||
bool ValidDropArea = (DockDropArea != InvalidDockWidgetArea) || (ContainerDropArea != InvalidDockWidgetArea);
|
||||
bool FloatingRequested = !d->DropContainer && !ValidDropArea;
|
||||
|
||||
// Non floatable auto hide widgets should stay in its current auto hide
|
||||
// state if they are dragged into a floating window
|
||||
if (!FloatingRequested || d->isContentFloatable())
|
||||
{
|
||||
cleanupAutoHideContainerWidget();
|
||||
}
|
||||
|
||||
if (!d->DropContainer)
|
||||
{
|
||||
d->createFloatingWidget();
|
||||
|
Loading…
Reference in New Issue
Block a user