Fix splitter size being saved incorrectly if the overlay widget is never opened

This commit is contained in:
Syarif Fakhri 2022-09-09 15:24:33 +08:00
parent 621e5e7789
commit 3ef1ac97c2

View File

@ -191,6 +191,19 @@ void COverlayDockContainer::addDockWidget(CDockWidget* DockWidget)
} }
d->DockArea->addDockWidget(DockWidget); d->DockArea->addDockWidget(DockWidget);
const auto dockContainerParent = parentContainer();
const auto rootSplitter = dockContainerParent->rootSplitter();
const auto rect = rootSplitter->frameGeometry();
const auto dockWidth = DockWidget->size().width();
if (d->Area == CDockWidgetSideTab::SideTabBarArea::Left)
{
d->Splitter->setSizes({ dockWidth, rect.width() - dockWidth });
}
else
{
d->Splitter->setSizes({ rect.width() - dockWidth, dockWidth });
}
updateSize(); updateSize();
updateMask(); updateMask();
} }