mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2024-12-27 00:11:33 +08:00
Changed moveContentsToParent() logic when disabling auto dock for a certain widget
This commit is contained in:
parent
a8a40f0bee
commit
e3117121cc
@ -339,19 +339,10 @@ CDockAreaWidget* CAutoHideDockContainer::dockAreaWidget() const
|
|||||||
void CAutoHideDockContainer::moveContentsToParent()
|
void CAutoHideDockContainer::moveContentsToParent()
|
||||||
{
|
{
|
||||||
cleanupAndDelete();
|
cleanupAndDelete();
|
||||||
|
// If we unpin the auto hide tock widget, then we insert it into the same
|
||||||
const auto position = mapToGlobal(d->getSimplifiedDockAreaPosition());
|
// location like it had as a auto hide widget. This brings the least surprise
|
||||||
|
// to the user and he does not have to search where the widget was inserted.
|
||||||
const auto dockAreaWidget = parentContainer()->dockAreaAt(position);
|
|
||||||
if (dockAreaWidget != nullptr && !dockAreaWidget->containsCentralWidget())
|
|
||||||
{
|
|
||||||
parentContainer()->addDockWidget(CenterDockWidgetArea, d->DockWidget, dockAreaWidget);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
parentContainer()->addDockWidget(d->getArea(d->SideTabBarArea), d->DockWidget);
|
parentContainer()->addDockWidget(d->getArea(d->SideTabBarArea), d->DockWidget);
|
||||||
}
|
|
||||||
|
|
||||||
parentContainer()->removeDockArea(d->DockArea);
|
parentContainer()->removeDockArea(d->DockArea);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user