From aaa95d5278493d48faa877a1c8acdd54169ced5b Mon Sep 17 00:00:00 2001 From: Loren Burkholder Date: Thu, 30 Nov 2023 23:20:24 -0500 Subject: [PATCH] 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. --- src/dolphinmainwindow.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/dolphinmainwindow.cpp b/src/dolphinmainwindow.cpp index e3591bcaf..967d4560f 100644 --- a/src/dolphinmainwindow.cpp +++ b/src/dolphinmainwindow.cpp @@ -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 -- 2.47.3