File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ Popup {
2222
2323 property alias existingSections: alphabetCategoryDelegateModel .model
2424 property int columns: 5
25+ property string currentCategory: " "
2526
2627 readonly property int cellWidth: 24
2728 readonly property int cellHeight: 24
@@ -31,6 +32,15 @@ Popup {
3132 width: alphabetCategoryContainer .width + 20
3233 height: alphabetCategoryContainer .height + 20
3334
35+ onCurrentCategoryChanged: {
36+ for (let i = 0 ; i < alphabetCategoryDelegateModel .model .length ; i++ ) {
37+ if (alphabetCategoryDelegateModel .model [i] === currentCategory) {
38+ alphabetCategoryContainer .currentIndex = i
39+ break
40+ }
41+ }
42+ }
43+
3444 DelegateModel {
3545 id: alphabetCategoryDelegateModel
3646
@@ -100,6 +110,18 @@ Popup {
100110 activeFocusOnTab: gridViewFocus
101111 }
102112
113+ Item {
114+ focus: root .visible
115+ Keys .onPressed : function (event ) {
116+ if (event .key === Qt .Key_Left ||
117+ event .key === Qt .Key_Right ||
118+ event .key === Qt .Key_Up ||
119+ event .key === Qt .Key_Down ) {
120+ alphabetCategoryContainer .focus = true
121+ }
122+ }
123+ }
124+
103125 background: FloatingPanel {
104126 radius: DStyle .Style .popup .radius
105127 dropShadowColor: null
Original file line number Diff line number Diff line change @@ -129,6 +129,7 @@ FocusScope {
129129 onClicked: {
130130 if (CategorizedSortProxyModel .categoryType === CategorizedSortProxyModel .Alphabetary ) {
131131 alphabetCategoryPopup .existingSections = CategorizedSortProxyModel .alphabetarySections ()
132+ alphabetCategoryPopup .currentCategory = section .toUpperCase ()
132133 var mousePos = mapToItem (listView, mouseX, mouseY)
133134 var y = (mousePos .y + alphabetCategoryPopup .height ) < listView .height ? mousePos .y : listView .height - alphabetCategoryPopup .height
134135 alphabetCategoryPopup .y = y
Original file line number Diff line number Diff line change @@ -36,6 +36,8 @@ FocusScope {
3636 readonly property alias gridViewWidth: gridView .width
3737 property alias highlight: gridView .highlight
3838 property ScrollBar vScrollBar
39+ property alias currentIndex: gridView .currentIndex
40+ property alias highlightMoveDuration: gridView .highlightMoveDuration
3941
4042 function positionViewAtBeginning () {
4143 gridView .positionViewAtBeginning ()
You can’t perform that action at this time.
0 commit comments