]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remove popout action from toolbar when split screen is closed
authorLoren Burkholder <computersemiexpert@outlook.com>
Fri, 1 Dec 2023 04:20:24 +0000 (23:20 -0500)
committerLoren Burkholder <computersemiexpert@outlook.com>
Thu, 18 Jan 2024 23:29:23 +0000 (23:29 +0000)
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

index e3591bcaf2d917e5d6e3d5626a284572a75416b0..967d4560f7b14c2374b372b6d886d8862c2d7ecd 100644 (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