Improved support for AutoHideTab drag and drop

This commit is contained in:
Uwe Kindler
2023-07-07 15:20:43 +02:00
parent 4307f48d99
commit bf22e54fc3
5 changed files with 43 additions and 72 deletions

View File

@@ -1229,17 +1229,12 @@ void CDockWidget::setAutoHide(bool Enable, SideBarLocation Location)
auto OldOrientation = AutoHideContainer->orientation();
auto SideBar = dockContainer()->autoHideSideBar(Location);
SideBar->addAutoHideWidget(AutoHideContainer);
// If we move a horizontal auto hide container to a vertical position
// then we resize it to the orginal dock widget size, to avoid
// an extremely streched dock widget after insertion
if (SideBar->orientation() != OldOrientation)
{
auto OriginalSize = AutoHideContainer->originalDockWidgetSize();
if (SideBar->orientation() == Qt::Horizontal)
{
AutoHideContainer->setSize(OriginalSize.height());
}
else
{
AutoHideContainer->setSize(OriginalSize.width());
}
AutoHideContainer->resetToInitialDockWidgetSize();
}
}
else