Commit f45d2e98 authored by Felix Ernst's avatar Felix Ernst 🇺🇦
Browse files

Add "Invert Selection" and "Select All" to bottom bar

In selection mode, a bottom bar with contextual actions appears
when at least one item is selected. This commit makes it so this
bottom bar also contains the "Invert Selection" and "Select All"
actions so users have more complete control over changing what is
and isn't selected while in selection mode.
parent 6b0dcb62
Pipeline #217903 passed with stage
in 6 minutes and 14 seconds
......@@ -498,6 +498,21 @@ std::vector<QAction *> BottomBarContentsContainer::contextActionsFor(const KFile
auto separator = new QAction(m_internalContextMenu.get());
// Add "Invert Selection" and "Select All" at the very end for better usability while in selection mode.
// Design-wise this decision is slightly questionable because the other actions in the bar apply to the selected items while
// the "select" actions apply to the view instead but we decided that there are more benefits than drawbacks to this.
auto invertSelectionAction = m_actionCollection->action(QStringLiteral("invert_selection"));
Q_ASSERT(invertSelectionAction && !internalContextMenuActions.contains(invertSelectionAction));
auto selectAllAction = m_actionCollection->action(KStandardAction::name(KStandardAction::SelectAll));
Q_ASSERT(selectAllAction && !internalContextMenuActions.contains(selectAllAction));
return contextActions;
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment