From: Nate Graham Date: Thu, 27 Mar 2025 19:29:26 +0000 (-0600) Subject: Move "Show in Groups" toggle action into Sort menu X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/commitdiff_plain/dd07a3273c53eb9f86f59c5ef74072433138a361 Move "Show in Groups" toggle action into Sort menu This is the sort of thing a user might want to toggle temporarily, as sometimes grouping is a helpful visualization and sometimes not. Right now, doing that is easy when using the in-window menubar or the global menu: View > Show in Groups. However when using the default hamburger menu, it becomes difficult: Burger menu > More > View > Show in Groups. It's four levels of nesting and requires precision. This change addresses that by moving the action into the "Sort By" menu. This improves discoverability for people using the default UI, and makes the location of the action consistent for people using all UI styles. It also gets the item into the view context menu, where it currently isn't, providing another entry point for it. --- diff --git a/src/dolphinpart.rc b/src/dolphinpart.rc index d13f4aaed..9887e5210 100644 --- a/src/dolphinpart.rc +++ b/src/dolphinpart.rc @@ -1,6 +1,6 @@ - + &Edit @@ -25,7 +25,6 @@ - diff --git a/src/dolphinui.rc b/src/dolphinui.rc index 7c2cb2bfc..c2939f879 100644 --- a/src/dolphinui.rc +++ b/src/dolphinui.rc @@ -1,6 +1,6 @@ - + @@ -46,7 +46,6 @@ - diff --git a/src/dolphinuiforphones.rc b/src/dolphinuiforphones.rc index ba5945cc3..94fb0c3e3 100644 --- a/src/dolphinuiforphones.rc +++ b/src/dolphinuiforphones.rc @@ -46,7 +46,6 @@ - diff --git a/src/views/dolphinviewactionhandler.cpp b/src/views/dolphinviewactionhandler.cpp index 4d5dba070..682a4314a 100644 --- a/src/views/dolphinviewactionhandler.cpp +++ b/src/views/dolphinviewactionhandler.cpp @@ -309,11 +309,17 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac m_currentView->setSortOrder(Qt::DescendingOrder); }); + KToggleAction *showInGroups = m_actionCollection->add(QStringLiteral("show_in_groups")); + showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); + showInGroups->setWhatsThis(i18nc("@info:whatsthis", "This groups files and folders by their first letter.")); + connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting); + sortByActionMenu->addAction(ascendingAction); sortByActionMenu->addAction(descendingAction); sortByActionMenu->addSeparator(); sortByActionMenu->addAction(sortFoldersFirst); sortByActionMenu->addAction(sortHiddenLast); + sortByActionMenu->addAction(showInGroups); // View -> Additional Information QActionGroup *visibleRolesGroup = createFileItemRolesActionGroup(QStringLiteral("show_")); @@ -328,12 +334,6 @@ void DolphinViewActionHandler::createActions(SelectionMode::ActionTextHelper *ac visibleRolesMenu->addAction(action); } - KToggleAction *showInGroups = m_actionCollection->add(QStringLiteral("show_in_groups")); - showInGroups->setIcon(QIcon::fromTheme(QStringLiteral("view-group"))); - showInGroups->setText(i18nc("@action:inmenu View", "Show in Groups")); - showInGroups->setWhatsThis(i18nc("@info:whatsthis", "This groups files and folders by their first letter.")); - connect(showInGroups, &KToggleAction::triggered, this, &DolphinViewActionHandler::toggleGroupedSorting); - KToggleAction *showHiddenFiles = m_actionCollection->add(QStringLiteral("show_hidden_files")); showHiddenFiles->setIcon(QIcon::fromTheme(QStringLiteral("view-visible"))); showHiddenFiles->setText(i18nc("@action:inmenu View", "Show Hidden Files"));