X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fqml%2FHistoryListDialog.qml;h=7b9ddc0ed7bcf1389f3e05165f9b95b1bd3bfce4;hb=9a5bedfd71b6c1a09fe77aea909d3d78a771a6e8;hp=feb7ad975794329a56dd9b26720ea1e8ea609e35;hpb=11ada56e37ed724c4777ad2ac555eabe19c65c12;p=mdictionary diff --git a/src/mdictionary/qml/HistoryListDialog.qml b/src/mdictionary/qml/HistoryListDialog.qml index feb7ad9..7b9ddc0 100644 --- a/src/mdictionary/qml/HistoryListDialog.qml +++ b/src/mdictionary/qml/HistoryListDialog.qml @@ -3,6 +3,9 @@ import Qt 4.7 Rectangle { SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } color : myPalette.window; + function setFocus() { + historyList.setFocus() + } signal selectedRow(int nr) @@ -26,6 +29,17 @@ Rectangle { anchors.bottom: parent.bottom anchors.top: parent.top 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){ + selectedRow(currentIndex) + } + } + delegate: Component{ id: historyListDelegate Item {