# HG changeset patch # User Chris Cannam # Date 1308911346 -3600 # Node ID 8df5d64bf7c56ad147f5fe9543e3110a7c372f4f # Parent 45f2e4cda1d7504a18a6eda4a075d149e75406f0 Save size before switching to minimal mode, restore it when switching back. This is the same mechanism as used to save/restore the window size when exiting & restarting the program diff -r 45f2e4cda1d7 -r 8df5d64bf7c5 main/MainWindow.cpp --- a/main/MainWindow.cpp Fri Jun 24 11:21:56 2011 +0100 +++ b/main/MainWindow.cpp Fri Jun 24 11:29:06 2011 +0100 @@ -4172,13 +4172,18 @@ void MainWindow::toggleViewMode() { + QSettings settings; + settings.beginGroup("MainWindow"); + + bool wasMinimal = m_viewManager->getMinimalModeEnabled(); bool show; - if (m_viewManager->getMinimalModeEnabled()) { + if (wasMinimal) { show = true; m_viewManager->setMinimalModeEnabled(false); m_scroll->show(); } else { + settings.setValue("size", size()); show = false; m_viewManager->setMinimalModeEnabled(true); m_scroll->hide(); @@ -4203,7 +4208,14 @@ //layout()->activate(); //layout()->update(); - adjustSize(); //shrinks successfully the main window but does not remove the space allocated for the central widget containing panes + + if (wasMinimal) { + resizeConstrained(settings.value("size").toSize()); + } else { + adjustSize(); //shrinks successfully the main window but does not remove the space allocated for the central widget containing panes + } + + settings.endGroup(); //TO-DOS: //- when switching back to full mode, the pane is not shown entirely, should restore the previous size