┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphincontextmenu.cpp
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2021-05-13 16:49:27 +0000
committerNate Graham <[email protected]>2021-05-13 16:49:27 +0000
commit53a778c1ebab4473da8ae7b18fd2f2ac75b9690a (patch)
tree070949ff96d109a090337ba9d95ef4ddd45c8dcc /src/dolphincontextmenu.cpp
parent4d9ea4261a1f24e299595b897ea790eab1748fe9 (diff)
Re-arrange the contents of the hamburger menu
To improve usability, the entries in the hamburger menu are changed. Maybe the biggest fault of the previous menu contents were that there were too many actions. The new menu contents are composed of all the actions which are necessary to use Dolphin and those which are very useful and should be of interest for most users. Some menu contents change depending on the state of the application. We can be more bold in only showing what really seems necessary because this commit activates the special sub-menu of KHamburgerMenu that helps users discover all further features of Dolphin. The hamburger menu is from now on also added to the context menus in the view when both the menu bar and toolbar are hidden. This allows users to hide both of them and still use all features of Dolphin.
Diffstat (limited to 'src/dolphincontextmenu.cpp')
-rw-r--r--src/dolphincontextmenu.cpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/src/dolphincontextmenu.cpp b/src/dolphincontextmenu.cpp
index ed6db0c12..4b287981c 100644
--- a/src/dolphincontextmenu.cpp
+++ b/src/dolphincontextmenu.cpp
@@ -22,6 +22,7 @@
#include <KActionCollection>
#include <KFileItemActions>
#include <KFileItemListProperties>
+#include <KHamburgerMenu>
#include <KIO/EmptyTrashJob>
#include <KIO/JobUiDelegate>
#include <KIO/Paste>
@@ -64,6 +65,9 @@ DolphinContextMenu::DolphinContextMenu(DolphinMainWindow* parent,
m_selectedItems = view->selectedItems();
installEventFilter(this);
+
+ static_cast<KHamburgerMenu *>(m_mainWindow->actionCollection()->
+ action(QStringLiteral("hamburger_menu")))->addToMenu(this);
}
DolphinContextMenu::~DolphinContextMenu()
@@ -149,8 +153,6 @@ void DolphinContextMenu::openTrashContextMenu()
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
- addShowMenuBarAction();
-
if (exec(m_pos) == emptyTrashAction) {
Trash::empty(m_mainWindow);
}
@@ -361,8 +363,6 @@ void DolphinContextMenu::openViewportContextMenu()
QAction* propertiesAction = m_mainWindow->actionCollection()->action(QStringLiteral("properties"));
addAction(propertiesAction);
- addShowMenuBarAction();
-
exec(m_pos);
}
@@ -423,16 +423,6 @@ void DolphinContextMenu::insertDefaultItemActions(const KFileItemListProperties&
}
}
-void DolphinContextMenu::addShowMenuBarAction()
-{
- const KActionCollection* ac = m_mainWindow->actionCollection();
- QAction* showMenuBar = ac->action(KStandardAction::name(KStandardAction::ShowMenubar));
- if (!m_mainWindow->menuBar()->isVisible() && !m_mainWindow->toolBar()->isVisible()) {
- addSeparator();
- addAction(showMenuBar);
- }
-}
-
bool DolphinContextMenu::placeExists(const QUrl& url) const
{
const KFilePlacesModel* placesModel = DolphinPlacesModelSingleton::instance().placesModel();