Add keyboard support to comboBox, HistoryList. Fix some issues with keyboard support.
[mdictionary] / src / mdictionary / qml / DictManagerWidget.qml
index bf9c2f0..d15be32 100644 (file)
@@ -60,6 +60,10 @@ Rectangle {
         highlightResizeSpeed: 1000
 
         Keys.onPressed: {
+            if ((currentIndex < 0 || currentIndex >= count) && (event.key == Qt.Key_Up || event.key == Qt.Key_Down)){
+                currentIndex = 0
+            }
+
             if ((event.key == Qt.Key_Return || event.key == Qt.Key_Enter) && currentIndex >= 0){
                 itemActivated(currentIndex)
             }
@@ -137,7 +141,6 @@ Rectangle {
         model: dictModel
     }
 
-    //buttons
 
     Item {
         id: buttonsBox