Ensure that the closed state is consistent

This commit is contained in:
Syarif Fakhri 2022-09-20 14:47:28 +08:00
parent 0e6971e2ae
commit 8ac8d63b96

View File

@ -485,6 +485,7 @@ void CDockAreaWidget::insertDockWidget(int index, CDockWidget* DockWidget,
if (Activate) if (Activate)
{ {
setCurrentIndex(index); setCurrentIndex(index);
DockWidget->setClosedState(false); // Set current index can show the widget without changing the close state, added to keep the close state consistent
} }
// If this dock area is hidden, then we need to make it visible again // If this dock area is hidden, then we need to make it visible again
// by calling DockWidget->toggleViewInternal(true); // by calling DockWidget->toggleViewInternal(true);
@ -641,6 +642,7 @@ void CDockAreaWidget::internalSetCurrentDockWidget(CDockWidget* DockWidget)
} }
setCurrentIndex(Index); setCurrentIndex(Index);
DockWidget->setClosedState(false); // Set current index can show the widget without changing the close state, added to keep the close state consistent
} }