X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fqml%2FWordListWidget.qml;fp=src%2Fmdictionary%2Fqml%2FWordListWidget.qml;h=9383549216b92ea2ad16b19661a33b8225fb8c92;hb=2ad12b428a1104b2aed0fc1011c1085f12a049ab;hp=288cbaff8e9bb32a1774a68fcefcb703c002bb3c;hpb=9427983f428542e40d737a9f7f719809c229a83d;p=mdictionary diff --git a/src/mdictionary/qml/WordListWidget.qml b/src/mdictionary/qml/WordListWidget.qml index 288cbaf..9383549 100644 --- a/src/mdictionary/qml/WordListWidget.qml +++ b/src/mdictionary/qml/WordListWidget.qml @@ -25,6 +25,9 @@ import Qt 4.7 Rectangle { + id: rectangle1 + color: myPalette.base + anchors.fill: parent function changeWordState(nr, state) { wordList.currentIndex = nr @@ -35,14 +38,10 @@ Rectangle { function setEnabled(Boolean) { wordList.enabled = Boolean } // slot signal wordSelected(string word); - + signal checkFocus(); SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } - id: rectangle1 - color: myPalette.base - anchors.fill: parent - ElementsListView{ id: wordList width: rectangle1.width @@ -53,6 +52,8 @@ Rectangle { delegate: Component{ id: wordListDelegate Item { + onActiveFocusChanged: rectangle1.checkFocus(); + width: rectangle1.width height: { if (wordText.height + 4 > check.height) @@ -60,10 +61,10 @@ Rectangle { else return check.height; } - MouseArea{ anchors.fill: parent - onClicked: { + onClicked: wordList.currentIndex = number + onDoubleClicked: { wordList.currentIndex = number rectangle1.wordSelected(word) } @@ -103,11 +104,17 @@ Rectangle { } } } - } - } model: wordModel } + + states: [ + State { + name: "noFocus"; + when: ((!wordList.focus) && (!rectangle1.focus)) + PropertyChanges { target: wordList.highlightItem; opacity:0} + } + ] }