X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fqml%2FWordListWidget.qml;h=4cd5f97a78dbc91f71614cf289383000fb18f368;hb=11ada56e37ed724c4777ad2ac555eabe19c65c12;hp=742cf498252b01b616c008c1e67014bdee7b6276;hpb=ebd4c2c97364e18aae17e790155b8f4060981c37;p=mdictionary diff --git a/src/mdictionary/qml/WordListWidget.qml b/src/mdictionary/qml/WordListWidget.qml index 742cf49..4cd5f97 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 @@ -43,13 +46,10 @@ Rectangle { signal wordSelected(string word); signal wordSelectedByIndex(int nr); + signal checkFocus(); SystemPalette { id: myPalette; colorGroup: SystemPalette.Active } - id: rectangle1 - color: myPalette.base - anchors.fill: parent - ElementsListView{ id: wordList width: rectangle1.width @@ -69,6 +69,8 @@ Rectangle { delegate: Component{ id: wordListDelegate Item { + onActiveFocusChanged: rectangle1.checkFocus(); + width: rectangle1.width height: { if (wordText.height + 4 > check.height) @@ -76,11 +78,11 @@ Rectangle { else return check.height; } - MouseArea{ anchors.fill: parent - onClicked: { - wordList.currentIndex = index + onClicked: wordList.currentIndex = index + onDoubleClicked: { + wordList.currentIndex = number rectangle1.wordSelected(word) } } @@ -100,13 +102,12 @@ Rectangle { pathToUncheckedImage: UncheckedPath anchors.right: parent.right anchors.rightMargin: 5 - + pathToCheckedDicImage: CheckedPath + pathToUncheckedDicImage: UncheckedPath anchors.verticalCenter: parent.verticalCenter onChanged: rectangle1.changeWordState(number, selected) } - } - } Text { @@ -150,4 +151,12 @@ Rectangle { } ] } + + states: [ + State { + name: "noFocus"; + when: ((!wordList.focus) && (!rectangle1.focus)) + PropertyChanges { target: wordList.highlightItem; opacity:0} + } + ] }