]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Add "Unlock panels" to main window context menu
authorKai Uwe Broulik <kde@privat.broulik.de>
Fri, 28 Jan 2022 19:02:49 +0000 (20:02 +0100)
committerKai Uwe Broulik <kde@privat.broulik.de>
Mon, 31 Jan 2022 12:06:08 +0000 (12:06 +0000)
It's the Qt-provided one that shows on the menu bar
and dock widget title bars.

src/dolphinmainwindow.cpp
src/dolphinmainwindow.h

index 9bcfc9ebb031bbc4768f6d952a701e0d3f452ba2..9b4ac64c9829d63e601914a12137754ec6584233 100644 (file)
@@ -1177,6 +1177,16 @@ void DolphinMainWindow::openContextMenu(const QPoint& pos,
     }
 }
 
+QMenu *DolphinMainWindow::createPopupMenu()
+{
+    QMenu *menu = KXmlGuiWindow::createPopupMenu();
+
+    menu->addSeparator();
+    menu->addAction(actionCollection()->action(QStringLiteral("lock_panels")));
+
+    return menu;
+}
+
 void DolphinMainWindow::updateHamburgerMenu()
 {
     KActionCollection* ac = actionCollection();
index 5ada022cbdec511cb195d0f03a9a51fa30ca6e23..1a3ec4efb7a7e8d3b9e112df506fc48c7b93abef 100644 (file)
@@ -95,6 +95,12 @@ public:
      */
     KNewFileMenu* newFileMenu() const;
 
+    /**
+     * Augments Qt's build-in QMainWindow context menu to add
+     * Dolphin-specific actions, such as "unlock panels".
+     */
+    QMenu *createPopupMenu() override;
+
     /**
      * Switch the window's view containers' locations to display the home path
      * for any which are currently displaying a location corresponding to or