Browse Source

bug-fix: do not save state of main splitter in compact mode

Le Tan 8 years ago
parent
commit
f428ba19f7
1 changed files with 8 additions and 7 deletions
  1. 8 7
      src/vmainwindow.cpp

+ 8 - 7
src/vmainwindow.cpp

@@ -2147,13 +2147,14 @@ void VMainWindow::saveStateAndGeometry()
     g_config->setMainWindowState(saveState());
     g_config->setToolsDockChecked(toolDock->isVisible());
 
-    // In one panel view, it will save the wrong state that the directory tree
-    // panel has a width of zero.
-    changePanelView(PanelViewState::TwoPanels);
-    g_config->setMainSplitterState(m_mainSplitter->saveState());
-
-    changePanelView(PanelViewState::CompactMode);
-    g_config->setNaviSplitterState(m_naviSplitter->saveState());
+    if (m_panelViewState == PanelViewState::CompactMode) {
+        g_config->setNaviSplitterState(m_naviSplitter->saveState());
+    } else {
+        // In one panel view, it will save the wrong state that the directory tree
+        // panel has a width of zero.
+        changePanelView(PanelViewState::TwoPanels);
+        g_config->setMainSplitterState(m_mainSplitter->saveState());
+    }
 }
 
 void VMainWindow::restoreStateAndGeometry()