on xenial help sign in
fix highlight looping
21675adMichael Zanetti
qml/Stages/DesktopStage.qml+2−2
@@ -47,7 +47,7 @@ FocusScope {
47 print("should tab next")
47 print("should tab next")
48 appRepeater.highlightedIndex = (appRepeater.highlightedIndex + 1) % ApplicationManager.count;
48 appRepeater.highlightedIndex = (appRepeater.highlightedIndex + 1) % ApplicationManager.count;
49 var newContentX = spreadFlickable.width / 5 * Math.max(0, Math.min(ApplicationManager.count - 5, appRepeater.highlightedIndex - 3));
49 var newContentX = spreadFlickable.width / 5 * Math.max(0, Math.min(ApplicationManager.count - 5, appRepeater.highlightedIndex - 3));
50− if (spreadFlickable.contentX < newContentX) {
50+ if (spreadFlickable.contentX < newContentX || appRepeater.highlightedIndex == 0) {
51 spreadFlickable.snapTo(newContentX)
51 spreadFlickable.snapTo(newContentX)
52 }
52 }
53 }
53 }
@@ -59,7 +59,7 @@ FocusScope {
59 var newIndex = appRepeater.highlightedIndex - 1 >= 0 ? appRepeater.highlightedIndex - 1 : ApplicationManager.count - 1;
59 var newIndex = appRepeater.highlightedIndex - 1 >= 0 ? appRepeater.highlightedIndex - 1 : ApplicationManager.count - 1;
60 appRepeater.highlightedIndex = newIndex;
60 appRepeater.highlightedIndex = newIndex;
61 var newContentX = spreadFlickable.width / 5 * Math.max(0, Math.min(ApplicationManager.count - 5, appRepeater.highlightedIndex - 1));
61 var newContentX = spreadFlickable.width / 5 * Math.max(0, Math.min(ApplicationManager.count - 5, appRepeater.highlightedIndex - 1));
62− if (spreadFlickable.contentX > newContentX) {
62+ if (spreadFlickable.contentX > newContentX || newIndex == ApplicationManager.count -1) {
63 spreadFlickable.snapTo(newContentX)
63 spreadFlickable.snapTo(newContentX)
64 }
64 }
65 }
65 }