]> cloud.milkyroute.net Git - dolphin.git/commitdiff
DolphinView: beginAnchoredSelection after setSelected in selectNextItem
authorAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 21 Nov 2024 12:42:45 +0000 (12:42 +0000)
committerAkseli Lahtinen <akselmo@akselmo.dev>
Thu, 21 Nov 2024 12:42:45 +0000 (12:42 +0000)
Currently when next item is set selected, it's not set as an anchor.
This means that shift-click will not select items between the selection
and the next item, and instead behaves like ctrl-click.
This is rather inconsistent behavior.

We should set the next selected item as an anchor so that shift-click
will work: This change starts the `beginAnchoredSelection`
process after `setSelection`.

For example, if user trashes an item and the next item is selected,
shift-click would stop working.

BUG:495371

src/views/dolphinview.cpp

index 6da285a87a9c12d5e24c5033531f102f7178451f..c12e3d5f7d080c9e3712ac5ec890af08af442cc1 100644 (file)
@@ -1881,6 +1881,7 @@ void DolphinView::selectNextItem()
         }
         if (nextItem >= 0) {
             selectionManager->setSelected(nextItem, 1);
+            selectionManager->beginAnchoredSelection(nextItem);
         }
         m_selectNextItem = false;
     }