summaryrefslogtreecommitdiffstats
path: root/qml/LaunchScreen.qml
diff options
context:
space:
mode:
Diffstat (limited to 'qml/LaunchScreen.qml')
-rw-r--r--qml/LaunchScreen.qml10
1 files changed, 9 insertions, 1 deletions
diff --git a/qml/LaunchScreen.qml b/qml/LaunchScreen.qml
index 2bf25a5..ee518be 100644
--- a/qml/LaunchScreen.qml
+++ b/qml/LaunchScreen.qml
@@ -55,7 +55,7 @@ Item {
offset: list.contentX;
- onClicked: {
+ function select() {
list.targetContentX = iconRoot.x - (list.width / 2 - list.cellWidth / 2);
list.targetIndex = index;
if (Math.abs(list.targetContentX - list.contentX) < 50) {
@@ -65,6 +65,7 @@ Item {
}
animateToCenter.running = true;
}
+ onClicked: select()
}
property int targetIndex;
@@ -84,6 +85,13 @@ Item {
nameLabel.text = ""
}
}
+
+ onMovementEnded: {
+ var center = mapToItem(contentItem, width / 2, height / 2)
+ itemAt(center.x, center.y).select()
+ }
+
+ onCountChanged: if (count > 0 && currentIndex < 0) currentIndex = 0
}
Text {