X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2Fmdictionary%2Fqml%2FWordListWidget.qml;h=145ad895ecf56334a819cdfd2f97c471125792f5;hb=08e403fb8f97d1352819f64d81eeda2c65148a40;hp=cb972fabd851a98788bc4bb705358d588ad8a595;hpb=415b9089f7fa7cbd4e592512a63781da339369d5;p=mdictionary diff --git a/src/mdictionary/qml/WordListWidget.qml b/src/mdictionary/qml/WordListWidget.qml index cb972fa..145ad89 100644 --- a/src/mdictionary/qml/WordListWidget.qml +++ b/src/mdictionary/qml/WordListWidget.qml @@ -27,6 +27,7 @@ import Qt 4.7 Rectangle { function changeWordState(nr, state) { + console.log("LOOOOOL") wordList.currentIndex = nr wordModel.setModelProperty(wordList.currentIndex, state, "isBookmarked") @@ -34,6 +35,13 @@ Rectangle { function setEnabled(Boolean) { wordList.enabled = Boolean } function setWordListEmpty(Boolean) { wordList.empty = Boolean } + function setFocus() { + console.log("juhu") + wordList.setFocus() +// activeFocus = true + console.log(focus + "a " + activeFocus) + console.log(wordList.focus + "b " + wordList.activeFocus) + } signal wordSelected(string word); @@ -51,6 +59,10 @@ Rectangle { highlightResizeSpeed: 1000 property bool empty: false + onCurrentIndexChanged: { + console.log("111!!!WTF " + currentIndex) + } + delegate: Component{ id: wordListDelegate Item { @@ -65,7 +77,7 @@ Rectangle { MouseArea{ anchors.fill: parent onClicked: { - wordList.currentIndex = number + wordList.currentIndex = index// number rectangle1.wordSelected(word) } } @@ -74,14 +86,7 @@ Rectangle { Text { id: wordText anchors.verticalCenter: parent.verticalCenter - text: - { - if (word == "!@#$%"){ - qsTr("Can't find any matching words") - } else { - word - } - } + text: word } Checkbox{ @@ -95,13 +100,6 @@ Rectangle { anchors.verticalCenter: parent.verticalCenter onChanged: rectangle1.changeWordState(number, selected) - visible: { - if (word == "!@#$%"){ - false - } else { - true - } - } } } @@ -115,6 +113,15 @@ Rectangle { text: qsTr("Can't find any matching words") } + Rectangle { + id: shadeDisable + anchors.centerIn: parent; + color: "grey"; + opacity: 0 + width: parent.width; + height: parent.height; + } + model: wordModel states: [ @@ -127,6 +134,16 @@ Rectangle { name: "non-empty" when: (wordList.empty == false); PropertyChanges { target: emptyText; visible: false} + }, + State { + name: "enabled" + when: (wordList.enabled == true); + PropertyChanges { target: shadeDisable; z: 30; opacity: 0.5 } + }, + State { + name: "disabled" + when: (wordList.enabled == false); + PropertyChanges { target: shadeDisable; z: 30; opacity: 0.0 } } ] }