Loop around
This commit is contained in:
@@ -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 } }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user