┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Ernst <[email protected]>2022-05-16 15:53:18 +0200
committerFelix Ernst <[email protected]>2022-08-14 14:42:40 +0000
commite464b58c33b27ea331225778c60ba3aa8b7fb1d5 (patch)
tree2665f44f8b0c4b44e5b2548279bbd427606e181b
parent261b741d5feb356c1fa8a8ac42397f53eb13ca75 (diff)
Address Nate's UX feedback: Episode 2
- 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.
-rw-r--r--src/dolphinviewcontainer.cpp7
-rw-r--r--src/kitemviews/kitemlistcontroller.cpp5
-rw-r--r--src/selectionmode/bottombarcontentscontainer.cpp4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/dolphinviewcontainer.cpp b/src/dolphinviewcontainer.cpp
index d69aa119f..f38995603 100644
--- a/src/dolphinviewcontainer.cpp
+++ b/src/dolphinviewcontainer.cpp
@@ -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;
}
diff --git a/src/kitemviews/kitemlistcontroller.cpp b/src/kitemviews/kitemlistcontroller.cpp
index c86dfb582..2c407dbe2 100644
--- a/src/kitemviews/kitemlistcontroller.cpp
+++ b/src/kitemviews/kitemlistcontroller.cpp
@@ -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();
diff --git a/src/selectionmode/bottombarcontentscontainer.cpp b/src/selectionmode/bottombarcontentscontainer.cpp
index cbfdac9b9..ab3a8e7c7 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);