]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Address Nate's UX feedback: Episode 2
authorFelix Ernst <fe.a.ernst@gmail.com>
Mon, 16 May 2022 13:53:18 +0000 (15:53 +0200)
committerFelix Ernst <fe.a.ernst@gmail.com>
Sun, 14 Aug 2022 14:42:40 +0000 (14:42 +0000)
- Make Esc leave selection mode and have it only clear selection
    when already outside selection mode.
- Let translators know that the "More" overflow button should only
    have a short text on it.
- Fix a crash that happened when any code tried to exit selection
    mode even though selection mode had never been enabled to begin
    with.

src/dolphinviewcontainer.cpp
src/kitemviews/kitemlistcontroller.cpp
src/selectionmode/bottombarcontentscontainer.cpp

index d69aa119f49727728c7425449adad69492f96a41..f3899560329e0bf0b937c3f179166789deee03ea 100644 (file)
@@ -379,13 +379,14 @@ void DolphinViewContainer::setSelectionModeEnabled(bool enabled, KActionCollecti
     m_view->setSelectionModeEnabled(enabled);
 
     if (!enabled) {
+        if (!wasEnabled) {
+            return; // nothing to do here
+        }
         Q_CHECK_PTR(m_selectionModeTopBar); // there is no point in disabling selectionMode when it wasn't even enabled once.
         Q_CHECK_PTR(m_selectionModeBottomBar);
         m_selectionModeTopBar->setVisible(false, WithAnimation);
         m_selectionModeBottomBar->setVisible(false, WithAnimation);
-        if (wasEnabled) {
-            Q_EMIT selectionModeChanged(false);
-        }
+        Q_EMIT selectionModeChanged(false);
         return;
     }
 
index c86dfb582ec5b4292412a213b8c9218eef76fdfb..2c407dbe2d9afb7a9afbfca05b841636116fe3d1 100644 (file)
@@ -430,10 +430,9 @@ bool KItemListController::keyPressEvent(QKeyEvent* event)
     }
 
     case Qt::Key_Escape:
-        if (m_selectionMode && m_selectionManager->selectedItems().count() < 1) {
+        if (m_selectionMode) {
             Q_EMIT selectionModeChangeRequested(false);
-        }
-        if (m_selectionBehavior != SingleSelection) {
+        } else if (m_selectionBehavior != SingleSelection) {
             m_selectionManager->clearSelection();
         }
         m_keyboardManager->cancelSearch();
index cbfdac9b96a4e1ea58c106f9245016569307f8e6..ab3a8e7c78da9a696b27c0c98c30355d5502e643 100644 (file)
@@ -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);