# HG changeset patch # User Teemu Piippo # Date 1655750979 -10800 # Node ID 414d392b9ae6af153c475f5ce1277e5d966cee63 # Parent 74ce5ac84f2502249f870cb670bd23769e9fa233 some improvements to dock widget handling diff -r 74ce5ac84f25 -r 414d392b9ae6 src/main.cpp --- a/src/main.cpp Mon Jun 20 21:14:27 2022 +0300 +++ b/src/main.cpp Mon Jun 20 21:49:39 2022 +0300 @@ -364,6 +364,7 @@ uiutilities::makeKeySequenceMap(uiutilities::collectActions(&mainWindow)); const auto saveSettings = [&]{ setSetting(mainWindow.saveGeometry()); + setSetting(mainWindow.saveState()); setSetting(recentlyOpenedFiles); setSetting(renderPreferences.style); setSetting(renderPreferences.drawAxes); @@ -644,7 +645,14 @@ } }); mainWindow.setWindowTitle(title()); + mainWindow.tabifyDockWidget(ui.messageLogDock, ui.toolOptionsDock); mainWindow.restoreGeometry(setting()); + mainWindow.restoreState(setting()); + // If a dock is made floating and the app is closed, the dock becomes invisible + // after the restoreState call. So we make them visible again shere. + for (QDockWidget* dock : mainWindow.findChildren()) { + dock->setVisible(true); + } restoreSettings(); updateRenderPreferences(&ui, &renderPreferences, &documents); mainWindow.show(); diff -r 74ce5ac84f25 -r 414d392b9ae6 src/mainwindow.ui --- a/src/mainwindow.ui Mon Jun 20 21:14:27 2022 +0300 +++ b/src/mainwindow.ui Mon Jun 20 21:49:39 2022 +0300 @@ -14,10 +14,7 @@ LDForge - true - - - QMainWindow::AllowNestedDocks|QMainWindow::AllowTabbedDocks|QMainWindow::AnimatedDocks + false @@ -45,7 +42,7 @@ 0 0 729 - 31 + 40 @@ -162,7 +159,7 @@ false - + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable @@ -214,7 +211,7 @@ - + QDockWidget::DockWidgetFloatable|QDockWidget::DockWidgetMovable diff -r 74ce5ac84f25 -r 414d392b9ae6 src/settings.h --- a/src/settings.h Mon Jun 20 21:14:27 2022 +0300 +++ b/src/settings.h Mon Jun 20 21:49:39 2022 +0300 @@ -35,6 +35,7 @@ SETTING(Wireframe, false) SETTING(DrawAxes, true) SETTING(MainWindowGeometry, QByteArray{}) +SETTING(MainWindowState, QByteArray{}) SETTING(MainSplitterState, QByteArray{}) SETTING(RecentFiles, QStringList{}) SETTING(ViewMode, QMdiArea::TabbedView)