diff --git a/containments/desktop/package/contents/ui/FolderView.qml b/containments/desktop/package/contents/ui/FolderView.qml --- a/containments/desktop/package/contents/ui/FolderView.qml +++ b/containments/desktop/package/contents/ui/FolderView.qml @@ -483,7 +483,7 @@ scrollDown = false; } - // Update rubberband geomety. + // Update rubberband geometry. if (main.rubberBand) { var rB = main.rubberBand; @@ -561,8 +561,13 @@ } 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,20 +641,20 @@ item.iconArea.width, item.iconArea.height); if (main.rubberBand.intersects(iconRect)) { - indices.push(positioner.map(index)); + indices.push(index); continue; } var labelRect = Qt.rect(itemX + item.labelArea.x, itemY + item.labelArea.y, 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); } } }