X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/261b741d5feb356c1fa8a8ac42397f53eb13ca75..a2c9c05de2dfabbb2bb614390c8e03023dad2bd1:/src/selectionmode/bottombarcontentscontainer.cpp diff --git a/src/selectionmode/bottombarcontentscontainer.cpp b/src/selectionmode/bottombarcontentscontainer.cpp index cbfdac9b9..1634cf4c9 100644 --- a/src/selectionmode/bottombarcontentscontainer.cpp +++ b/src/selectionmode/bottombarcontentscontainer.cpp @@ -291,9 +291,9 @@ void BottomBarContentsContainer::addDuplicateContents() void BottomBarContentsContainer::addGeneralContents() { if (!m_overflowButton) { - // i18n: This button appears in a bar if there isn't enough horizontal space to fit all the other buttons. + // i18n: This button appears in a bar if there isn't enough horizontal space to fit all the other buttons so please keep it short. // The small button opens a menu that contains the actions that didn't fit on the bar. - m_overflowButton = new QPushButton{QIcon::fromTheme(QStringLiteral("view-more-symbolic")), i18nc("@action", "More"), this}; + m_overflowButton = new QPushButton{QIcon::fromTheme(QStringLiteral("view-more-symbolic")), i18nc("@action keep short", "More"), this}; m_overflowButton->setMenu(new QMenu{m_overflowButton}); m_overflowButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::MinimumExpanding); // Makes sure it has the same height as the labeled buttons. m_layout->addWidget(m_overflowButton); @@ -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 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; }