bug-fix: locating to current file should not always change to two panels view

This commit is contained in:
Le Tan 2017-10-17 19:49:18 +08:00
parent 787c61a5af
commit ce2a572211
2 changed files with 15 additions and 4 deletions

View File

@ -301,9 +301,7 @@ void VMainWindow::initViewToolBar(QSize p_iconSize)
break; break;
case (int)PanelViewState::CompactMode: case (int)PanelViewState::CompactMode:
m_panelViewState = PanelViewState::CompactMode; compactModeView();
g_config->setEnableCompactMode(true);
changePanelView(m_panelViewState);
break; break;
default: default:
@ -1807,6 +1805,13 @@ void VMainWindow::twoPanelView()
changePanelView(m_panelViewState); changePanelView(m_panelViewState);
} }
void VMainWindow::compactModeView()
{
m_panelViewState = PanelViewState::CompactMode;
g_config->setEnableCompactMode(true);
changePanelView(m_panelViewState);
}
void VMainWindow::toggleOnePanelView() void VMainWindow::toggleOnePanelView()
{ {
if (m_panelViewState == PanelViewState::TwoPanels) { if (m_panelViewState == PanelViewState::TwoPanels) {
@ -2139,7 +2144,11 @@ bool VMainWindow::locateFile(VFile *p_file)
} }
// Open the directory and file panels after location. // Open the directory and file panels after location.
twoPanelView(); if (m_panelViewState == PanelViewState::CompactMode) {
compactModeView();
} else {
twoPanelView();
}
return ret; return ret;
} }

View File

@ -119,6 +119,7 @@ private slots:
void changeHighlightTrailingSapce(bool p_checked); void changeHighlightTrailingSapce(bool p_checked);
void onePanelView(); void onePanelView();
void twoPanelView(); void twoPanelView();
void compactModeView();
void curEditFileInfo(); void curEditFileInfo();
void deleteCurNote(); void deleteCurNote();
void handleCurrentDirectoryChanged(const VDirectory *p_dir); void handleCurrentDirectoryChanged(const VDirectory *p_dir);
@ -268,6 +269,7 @@ private:
VVimIndicator *m_vimIndicator; VVimIndicator *m_vimIndicator;
VTabIndicator *m_tabIndicator; VTabIndicator *m_tabIndicator;
// SinglePanel, TwoPanels, CompactMode.
PanelViewState m_panelViewState; PanelViewState m_panelViewState;
// Actions // Actions