mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-25 23:51:33 +08:00
Added support for delete on close to overlayed widgets
This commit is contained in:
parent
54b9a8dc50
commit
22402e79f5
@ -46,6 +46,7 @@ CMainWindow::CMainWindow(QWidget *parent)
|
|||||||
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
TableDockWidget->setMinimumSizeHintMode(CDockWidget::MinimumSizeHintFromDockWidget);
|
||||||
TableDockWidget->resize(250, 150);
|
TableDockWidget->resize(250, 150);
|
||||||
TableDockWidget->setMinimumSize(200,150);
|
TableDockWidget->setMinimumSize(200,150);
|
||||||
|
TableDockWidget->setFeature(CDockWidget::DockWidgetDeleteOnClose, true);
|
||||||
DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::Left, TableDockWidget);
|
DockManager->addOverlayDockWidget(CDockWidgetSideTab::SideTabBarArea::Left, TableDockWidget);
|
||||||
ui->menuView->addAction(TableDockWidget->toggleViewAction());
|
ui->menuView->addAction(TableDockWidget->toggleViewAction());
|
||||||
|
|
||||||
|
@ -1050,12 +1050,20 @@ void CDockAreaWidget::closeArea()
|
|||||||
for (auto DockWidget : openedDockWidgets())
|
for (auto DockWidget : openedDockWidgets())
|
||||||
{
|
{
|
||||||
if ((DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) ||
|
if ((DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && DockWidget->features().testFlag(CDockWidget::DockWidgetForceCloseWithArea)) ||
|
||||||
DockWidget->features().testFlag(CDockWidget::CustomCloseHandling) && !isOverlayed())
|
DockWidget->features().testFlag(CDockWidget::CustomCloseHandling))
|
||||||
|
{
|
||||||
DockWidget->closeDockWidgetInternal();
|
DockWidget->closeDockWidgetInternal();
|
||||||
|
}
|
||||||
|
else if (DockWidget->features().testFlag(CDockWidget::DockWidgetDeleteOnClose) && isOverlayed())
|
||||||
|
{
|
||||||
|
DockWidget->closeDockWidgetInternal();
|
||||||
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
DockWidget->toggleView(false);
|
DockWidget->toggleView(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//============================================================================
|
//============================================================================
|
||||||
|
@ -1015,6 +1015,10 @@ bool CDockWidget::closeDockWidgetInternal(bool ForceClose)
|
|||||||
FloatingWidget->hide();
|
FloatingWidget->hide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (d->DockArea && d->DockArea->isOverlayed())
|
||||||
|
{
|
||||||
|
d->DockArea->overlayDockContainer()->cleanupAndDelete();
|
||||||
|
}
|
||||||
deleteDockWidget();
|
deleteDockWidget();
|
||||||
Q_EMIT closed();
|
Q_EMIT closed();
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user