@@ -26,6 +26,7 @@ import QtQml 6.2
2626Page {
2727 id: versionPage
2828 property int prevSource: 0
29+ property int prevIndex: 0
2930
3031 ColumnLayout {
3132 anchors .fill : parent
@@ -49,25 +50,28 @@ Page {
4950 }
5051
5152 RadioButton {
52- checked: true
53+ checked: releases . filterSource == Units . Source . Product
5354 text: qsTr (" Official Editions" )
5455 onClicked: changeFilter (Units .Source .Product )
5556 ButtonGroup .group : radioGroup
5657 }
5758
5859 RadioButton {
60+ checked: releases .filterSource == Units .Source .Emerging
5961 text: qsTr (" Emerging Editions" )
6062 onClicked: changeFilter (Units .Source .Emerging )
6163 ButtonGroup .group : radioGroup
6264 }
6365
6466 RadioButton {
67+ checked: releases .filterSource == Units .Source .Spins
6568 text: qsTr (" Spins" )
6669 onClicked: changeFilter (Units .Source .Spins )
6770 ButtonGroup .group : radioGroup
6871 }
6972
7073 RadioButton {
74+ checked: releases .filterSource == Units .Source .Labs
7175 text: qsTr (" Labs" )
7276 onClicked: changeFilter (Units .Source .Labs )
7377 ButtonGroup .group : radioGroup
@@ -102,4 +106,38 @@ Page {
102106 releases .selectedIndex = parseInt (selectFromComboBox .currentValue )
103107 }
104108 }
109+
110+ Keys .onPressed : (event )=> {
111+ switch (event .key ) {
112+ case (Qt .Key_1 ):
113+ changeFilter (Units .Source .Product )
114+ break
115+ case (Qt .Key_2 ):
116+ changeFilter (Units .Source .Emerging )
117+ break
118+ case (Qt .Key_3 ):
119+ changeFilter (Units .Source .Spins )
120+ break
121+ case (Qt .Key_4 ):
122+ changeFilter (Units .Source .Labs )
123+ break
124+ case (Qt .Key_Return ):
125+ case (Qt .Key_Enter ):
126+ if (selectFromComboBox .down )
127+ selectFromComboBox .popup .close ()
128+ else
129+ selectFromComboBox .popup .open ()
130+ break
131+ case (Qt .Key_Up ):
132+ if (selectFromComboBox .down )
133+ if (releases .firstSource < releases .selectedIndex )
134+ selectFromComboBox .currentIndex -= 1
135+ break
136+ case (Qt .Key_Down ):
137+ if (selectFromComboBox .down )
138+ if (selectFromComboBox .count > selectFromComboBox .currentIndex + 1 )
139+ selectFromComboBox .currentIndex += 1
140+ break
141+ }
142+ }
105143}
0 commit comments