]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/selectionmode/bottombarcontentscontainer.cpp
GIT_SILENT Sync po/docbooks with svn
[dolphin.git] / src / selectionmode / bottombarcontentscontainer.cpp
index ab3a8e7c78da9a696b27c0c98c30355d5502e643..1634cf4c98a9c12de328b5b29925c0a2e86d5b0f 100644 (file)
@@ -388,7 +388,7 @@ void BottomBarContentsContainer::addPasteContents()
      * So we first have to claim that we have different contents before requesting to leave selection mode. */
     auto actuallyLeaveSelectionMode = [this]() {
         m_contents = BottomBar::Contents::CopyLocationContents;
-        Q_EMIT selectionModeLeavingRequested();
+        Q_EMIT barVisibilityChangeRequested(false);
     };
 
     auto *pasteButton = new QPushButton(this);
@@ -498,6 +498,21 @@ std::vector<QAction *> BottomBarContentsContainer::contextActionsFor(const KFile
             }
         }
     }
+
+    auto separator = new QAction(m_internalContextMenu.get());
+    separator->setSeparator(true);
+    contextActions.emplace_back(separator);
+
+    // 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));
+    contextActions.emplace_back(invertSelectionAction);
+    auto selectAllAction = m_actionCollection->action(KStandardAction::name(KStandardAction::SelectAll));
+    Q_ASSERT(selectAllAction && !internalContextMenuActions.contains(selectAllAction));
+    contextActions.emplace_back(selectAllAction);
+
     return contextActions;
 }