diff --git a/qml/AppListView.qml b/qml/AppListView.qml index 8df13a63..b346c95b 100644 --- a/qml/AppListView.qml +++ b/qml/AppListView.qml @@ -24,7 +24,7 @@ Item { // the scroll might stopped before the highlight item scroll to the expected place. // Thus we use a timer to set back these values with a delay. listView.highlightMoveDuration = 150 - listView.highlightRangeMode = GridView.NoHighlightRange + listView.highlightRangeMode = ListView.NoHighlightRange } } @@ -34,7 +34,7 @@ Item { if (character === transliterated1st) { // we use the highlight move to scroll to item listView.highlightMoveDuration = 0 - listView.highlightRangeMode = GridView.ApplyRange + listView.highlightRangeMode = ListView.StrictlyEnforceRange listView.currentIndex = i postScrollDeferTimer.restart() break @@ -42,6 +42,12 @@ Item { } } + function scrollToHighlight() { + listView.highlightMoveDuration = 0 + listView.highlightRangeMode = ListView.StrictlyEnforceRange + postScrollDeferTimer.restart() + } + Component { id: sectionHeading ToolButton { @@ -86,6 +92,12 @@ Item { // displayMarginBeginning: -45 clip: true focus: true + onFocusChanged: { + if (focus) { + // When focus in, we always scroll to the highlight + scrollToHighlight() + } + } section.property: CategorizedSortProxyModel.sortRoleName // "transliterated" // "category" section.criteria: section.property === "transliterated" ? ViewSection.FirstCharacter : ViewSection.FullString