Skip to content

Commit

Permalink
Close the inactive split view when pressing F3 instead of the active …
Browse files Browse the repository at this point in the history
  • Loading branch information
Zren committed Aug 3, 2018
1 parent 1b79553 commit 2b546cc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
8 changes: 4 additions & 4 deletions src/dolphinmainwindow.cpp
Expand Up @@ -1558,13 +1558,13 @@ void DolphinMainWindow::updateSplitAction()
const DolphinTabPage* tabPage = m_tabWidget->currentTabPage();
if (tabPage->splitViewEnabled()) {
if (tabPage->primaryViewActive()) {
splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close left view"));
splitAction->setIcon(QIcon::fromTheme(QStringLiteral("view-left-close")));
} else {
splitAction->setText(i18nc("@action:intoolbar Close right view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close right view"));
splitAction->setIcon(QIcon::fromTheme(QStringLiteral("view-right-close")));
} else {
splitAction->setText(i18nc("@action:intoolbar Close left view", "Close"));
splitAction->setToolTip(i18nc("@info", "Close left view"));
splitAction->setIcon(QIcon::fromTheme(QStringLiteral("view-left-close")));
}
} else {
splitAction->setText(i18nc("@action:intoolbar Split view", "Split"));
Expand Down
10 changes: 5 additions & 5 deletions src/dolphintabpage.cpp
Expand Up @@ -88,14 +88,14 @@ void DolphinTabPage::setSplitViewEnabled(bool enabled, const QUrl &secondaryUrl)
m_secondaryViewContainer->show();
m_secondaryViewContainer->setActive(true);
} else {
// Close the view which is active.
DolphinViewContainer* view = activeViewContainer();
if (m_primaryViewActive) {
// If the primary view is active, we have to swap the pointers
// Close the view which is inactive.
if (!m_primaryViewActive) {
// If the secondary view is active, we have to swap the pointers
// because the secondary view will be the new primary view.
qSwap(m_primaryViewContainer, m_secondaryViewContainer);
m_primaryViewActive = false;
m_primaryViewActive = true;
}
DolphinViewContainer* view = m_secondaryViewContainer;
m_primaryViewContainer->setActive(true);
view->close();
view->deleteLater();
Expand Down

0 comments on commit 2b546cc

Please sign in to comment.