1
0
mirror of https://invent.kde.org/system/dolphin synced 2024-07-04 17:30:55 +00:00

Remove popout action from toolbar when split screen is closed

It's pointless to show the popout action when splitscreen is closed,
so we'll remove it as a child of the splitscreen action whenever the
screen is not split.
This commit is contained in:
Loren Burkholder 2023-11-30 23:20:24 -05:00
parent 830dd0148a
commit aaa95d5278

View File

@ -1855,7 +1855,6 @@ void DolphinMainWindow::setupActions()
"view out into a new window."));
popoutSplit->setIcon(QIcon::fromTheme(QStringLiteral("window-new")));
actionCollection()->setDefaultShortcut(popoutSplit, Qt::SHIFT | Qt::Key_F3);
m_splitViewAction->addAction(popoutSplit);
connect(popoutSplit, &QAction::triggered, this, &DolphinMainWindow::popoutSplitView);
QAction *stashSplit = actionCollection()->addAction(QStringLiteral("split_stash"));
@ -2553,12 +2552,14 @@ void DolphinMainWindow::updateSplitActions()
popoutSplitAction->setToolTip(i18nc("@info", "Move right split view to a new window"));
}
popoutSplitAction->setEnabled(true);
m_splitViewAction->addAction(popoutSplitAction);
} else {
m_splitViewAction->setText(i18nc("@action:intoolbar Split view", "Split"));
m_splitViewAction->setToolTip(i18nc("@info", "Split view"));
m_splitViewAction->setIcon(QIcon::fromTheme(QStringLiteral("view-right-new")));
popoutSplitAction->setText(i18nc("@action:intoolbar Move active split view to a new window", "Pop out"));
popoutSplitAction->setEnabled(false);
m_splitViewAction->removeAction(popoutSplitAction);
}
// Update state from toolbar action