1 /*******************************************************************************
3 This file is part of mDictionary.
5 mDictionary is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
10 mDictionary is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with mDictionary. If not, see <http://www.gnu.org/licenses/>.
18 Copyright 2010 Comarch S.A.
20 *******************************************************************************/
22 author: Marcin Kaźmierczak <marcin.kazmierczak@comarch.pl>
29 function changeWordState(nr, state) {
30 console.log("LOOOOOL")
31 wordList.currentIndex = nr
32 wordModel.setModelProperty(wordList.currentIndex, state, "isBookmarked")
36 function setEnabled(Boolean) { wordList.enabled = Boolean }
37 function setWordListEmpty(Boolean) { wordList.empty = Boolean }
42 console.log(focus + "a " + activeFocus)
43 console.log(wordList.focus + "b " + wordList.activeFocus)
46 signal wordSelected(string word);
48 SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
56 width: rectangle1.width
59 highlightResizeSpeed: 1000
60 property bool empty: false
62 onCurrentIndexChanged: {
63 console.log("111!!!WTF " + currentIndex)
69 width: rectangle1.width
71 if (wordText.height + 4 > check.height)
72 return wordText.height + 4;
80 wordList.currentIndex = index// number
81 rectangle1.wordSelected(word)
88 anchors.verticalCenter: parent.verticalCenter
94 width: wordText.height
95 selected: isBookmarked
96 pathToCheckedImage: CheckedPath
97 pathToUncheckedImage: UncheckedPath
98 anchors.right: parent.right
99 anchors.rightMargin: 5
101 anchors.verticalCenter: parent.verticalCenter
102 onChanged: rectangle1.changeWordState(number, selected)
111 anchors.top: parent.top
112 anchors.left: parent.left
113 text: qsTr("Can't find any matching words")
118 anchors.centerIn: parent;
122 height: parent.height;
130 when: (wordList.empty == true);
131 PropertyChanges { target: emptyText; visible: true}
135 when: (wordList.empty == false);
136 PropertyChanges { target: emptyText; visible: false}
140 when: (wordList.enabled == true);
141 PropertyChanges { target: shadeDisable; z: 30; opacity: 0.5 }
145 when: (wordList.enabled == false);
146 PropertyChanges { target: shadeDisable; z: 30; opacity: 0.0 }