Loop around

This commit is contained in:
David Heinemeier Hansson
2026-05-14 12:32:19 +02:00
parent 6891c996b5
commit 4a11ca7ae9
+5 -9
View File
@@ -127,19 +127,16 @@ ShellRoot {
} }
function selectAdjacent(direction) { function selectAdjacent(direction) {
if (!filterText) { var count = imageModel.count
select(selectedIndex + direction) if (count === 0) return
return
}
var index = selectedIndex + direction var index = selectedIndex
while (index >= 0 && index < imageModel.count) { for (var i = 0; i < count; i++) {
index = (index + direction + count) % count
if (itemMatches(index)) { if (itemMatches(index)) {
select(index) select(index)
return return
} }
index += direction
} }
} }
@@ -521,7 +518,6 @@ ShellRoot {
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
color: root.withAlpha(root.background, item.selected ? 0 : 0.42) color: root.withAlpha(root.background, item.selected ? 0 : 0.42)
Behavior on color { ColorAnimation { duration: 120 } }
} }
} }