summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEike Hein <hein@kde.org>2017-01-03 09:24:00 (GMT)
committerEike Hein <hein@kde.org>2017-01-03 09:36:05 (GMT)
commit2b9e0e7cc61aa4d3811cde8db92ddb2795e4e97c (patch)
tree9b9b46eea8b10d2c8b8a7ce4b965756f2e0d400e
parentd674ede6e5f22281fa2461546ddc25ff5f3a7015 (diff)
Set current index to start of selection range when performing rectangle selection.
Summary: BUG:374030 Reviewers: #plasma, broulik Subscribers: plasma-devel Tags: #plasma Differential Revision: https://phabricator.kde.org/D3932
-rw-r--r--containments/desktop/package/contents/ui/FolderView.qml17
1 files changed, 11 insertions, 6 deletions
diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml
index 8936532..e589c03 100644
--- a/containments/desktop/package/contents/ui/FolderView.qml
+++ b/containments/desktop/package/contents/ui/FolderView.qml
@@ -483,7 +483,7 @@ Item {
scrollDown = false;
}
- // Update rubberband geomety.
+ // Update rubberband geometry.
if (main.rubberBand) {
var rB = main.rubberBand;
@@ -561,8 +561,13 @@ Item {
}
onCachedRectangleSelectionChanged: {
- if (cachedRectangleSelection) {
- dir.updateSelection(cachedRectangleSelection, gridView.ctrlPressed);
+ if (cachedRectangleSelection.length) {
+ // Set current index to start of selection.
+ // cachedRectangleSelection is pre-sorted.
+ currentIndex = cachedRectangleSelection[0];
+
+ dir.updateSelection(cachedRectangleSelection.map(positioner.map),
+ gridView.ctrlPressed);
}
}
@@ -636,7 +641,7 @@ Item {
item.iconArea.width, item.iconArea.height);
if (main.rubberBand.intersects(iconRect)) {
- indices.push(positioner.map(index));
+ indices.push(index);
continue;
}
@@ -644,12 +649,12 @@ Item {
item.labelArea.width, item.labelArea.height);
if (main.rubberBand.intersects(labelRect)) {
- indices.push(positioner.map(index));
+ indices.push(index);
continue;
}
} else {
// Otherwise be content with the cell intersection.
- indices.push(positioner.map(index));
+ indices.push(index);
}
}
}