mirror of
https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System.git
synced 2025-01-13 16:42:06 +08:00
Fixed restoreSideBar function and dropping floating widget with auto hide widgets
This commit is contained in:
parent
7b9f9e10e5
commit
260a2ddb24
@ -303,7 +303,8 @@ CAutoHideDockContainer::~CAutoHideDockContainer()
|
||||
//============================================================================
|
||||
CAutoHideSideBar* CAutoHideDockContainer::sideBar() const
|
||||
{
|
||||
return dockContainer()->sideTabBar(d->SideTabBarArea);
|
||||
auto DockContainer = dockContainer();
|
||||
return DockContainer ? DockContainer->sideTabBar(d->SideTabBarArea) : nullptr;
|
||||
}
|
||||
|
||||
|
||||
|
@ -1110,8 +1110,7 @@ bool DockContainerWidgetPrivate::restoreSideBar(CDockingStateReader& s,
|
||||
AutoHideContainer = DockWidget->autoHideDockContainer();
|
||||
if (AutoHideContainer->sideBar() != SideBar)
|
||||
{
|
||||
AutoHideContainer->autoHideTab()->removeFromSideBar();
|
||||
SideBar->insertTab(-1, AutoHideContainer->autoHideTab());
|
||||
SideBar->addAutoHideWidget(AutoHideContainer);
|
||||
}
|
||||
}
|
||||
else
|
||||
@ -1637,12 +1636,6 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
auto ContainerDropArea = d->DockManager->containerOverlay()->dropAreaUnderCursor();
|
||||
bool Dropped = false;
|
||||
|
||||
auto autoHideWidgets = FloatingWidget->dockContainer()->autoHideWidgets();
|
||||
for (const auto autohideWidget : autoHideWidgets)
|
||||
{
|
||||
createAndSetupAutoHideContainer(autohideWidget->sideBarLocation(), autohideWidget->dockWidget());
|
||||
}
|
||||
|
||||
if (DockArea)
|
||||
{
|
||||
auto dropOverlay = d->DockManager->dockAreaOverlay();
|
||||
@ -1674,6 +1667,14 @@ void CDockContainerWidget::dropFloatingWidget(CFloatingDockContainer* FloatingWi
|
||||
}
|
||||
}
|
||||
|
||||
// Remove the auto hide widgets from the FloatingWidget and insert
|
||||
// them into this widget
|
||||
for (auto AutohideWidget : FloatingWidget->dockContainer()->autoHideWidgets())
|
||||
{
|
||||
auto SideBar = sideTabBar(AutohideWidget->sideBarLocation());
|
||||
SideBar->addAutoHideWidget(AutohideWidget);
|
||||
}
|
||||
|
||||
if (Dropped)
|
||||
{
|
||||
// Fix https://github.com/githubuser0xFFFF/Qt-Advanced-Docking-System/issues/351
|
||||
|
@ -83,6 +83,7 @@ private:
|
||||
friend CAutoHideTab;
|
||||
friend AutoHideTabPrivate;
|
||||
friend AutoHideDockContainerPrivate;
|
||||
friend CAutoHideSideBar;
|
||||
|
||||
protected:
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user