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

This commit is contained in:
Le Tan 2017-12-07 20:41:40 +08:00
parent 8e48b43cda
commit f428ba19f7

View File

@ -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()