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>
28 SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
30 function setEnableRemove(Boolean) { removeButton.enabled = Boolean }
31 function setEnableSettings(Boolean) { settingsButton.enabled = Boolean }
33 signal addButtonClicked;
34 signal removeButtonClicked;
35 signal settingsButtonClicked;
36 signal saveButtonClicked;
37 signal itemActivated(int nr);
45 width: rectangle1.width
46 // height: rectangle1.height
47 anchors.top: parent.top
48 anchors.bottom: buttonsBox.top
49 anchors.bottomMargin: buttonsBox.height + buttonsBox.anchors.topMargin
50 highlightResizeSpeed: 1000
54 width: rectangle1.width
56 if (nameText.height + 4 > logo.height)
57 return nameText.height + 4;
64 dictList.currentIndex = number
65 rectangle1.setEnableRemove(true)
66 rectangle1.setEnableSettings(true)
69 rectangle1.itemActivated(dictList.currentIndex)
77 var aspectRatio = sourceSize.height / sourceSize.width
78 return checkbox.width * aspectRatio
80 anchors.verticalCenter: parent.verticalCenter
81 width: nameText.height
86 when: (isSelected == true);
88 PropertyChanges { target: checkbox; source: "qrc:/button/checkboxChecked.png" }
92 when: (isSelected == false);
94 PropertyChanges { target: checkbox; source: "qrc:/button/checkbox.png" }
100 dictList.currentIndex = number
101 dictModel.setModelProperty(dictList.currentIndex, !isSelected, "isSelected")
102 rectangle1.setEnableRemove(true)
103 rectangle1.setEnableSettings(true)
112 var aspectRatio = sourceSize.height / sourceSize.width
113 return logo.width * aspectRatio
115 anchors.left: checkbox.right
116 anchors.leftMargin: 5
117 anchors.verticalCenter: parent.verticalCenter
118 width: nameText.height + 4
124 anchors.left: logo.right
125 anchors.leftMargin: 5
126 anchors.verticalCenter: parent.verticalCenter
141 anchors.bottom: parent.bottom
142 anchors.top: dictList.bottom
147 width: (parent.width - 4) / 4
148 height: buttonsBox.height
149 anchors.left: buttonsBox.left
150 anchors.leftMargin: 4
151 anchors.verticalCenter: parent.verticalCenter
152 textInButton: qsTr("Add")
153 onClicked: rectangle1.addButtonClicked
158 width: (parent.width - 4) / 4
159 height: buttonsBox.height
160 anchors.left: addButton.right
161 anchors.leftMargin: 4
162 anchors.verticalCenter: parent.verticalCenter
163 textInButton: qsTr("Remove")
165 onClicked: rectangle1.removeButtonClicked
170 width: (parent.width - 4) / 4
171 height: buttonsBox.height
172 anchors.left: removeButton.right
173 anchors.leftMargin: 4
174 anchors.verticalCenter: parent.verticalCenter
175 textInButton: qsTr("Settings")
177 onClicked: rectangle1.settingsButtonClicked
182 width: (parent.width - 4) / 4
183 height: buttonsBox.height
184 anchors.left: settingsButton.right
185 anchors.leftMargin: 4
186 anchors.right: buttonsBox.right
187 anchors.rightMargin: 4
188 anchors.verticalCenter: parent.verticalCenter
189 textInButton: qsTr("Save")
190 onClicked: rectangle1.saveButtonClicked