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 }
32 function changeDictionaryState(nr, state) {
33 dictList.currentIndex = nr
34 dictModel.setModelProperty(dictList.currentIndex, state, "isSelected")
35 rectangle1.setEnableRemove(true)
36 rectangle1.setEnableSettings(true)
39 signal addButtonClicked;
40 signal removeButtonClicked;
41 signal settingsButtonClicked;
42 signal saveButtonClicked;
43 signal itemActivated(int nr);
51 width: rectangle1.width
52 // height: rectangle1.height
53 anchors.top: parent.top
54 anchors.bottom: buttonsBox.top
55 anchors.bottomMargin: buttonsBox.height + buttonsBox.anchors.topMargin
56 highlightResizeSpeed: 1000
60 width: rectangle1.width
62 if (nameText.height + 4 > logo.height)
63 return nameText.height + 4;
70 dictList.currentIndex = number
71 rectangle1.setEnableRemove(true)
72 rectangle1.setEnableSettings(true)
73 dictModel.itemSelected(dictList.currentIndex)
76 rectangle1.itemActivated(dictList.currentIndex)
83 width: nameText.height
85 onChanged: rectangle1.changeDictionaryState(number, selected)
93 var aspectRatio = sourceSize.height / sourceSize.width
94 return logo.width * aspectRatio
97 anchors.verticalCenter: parent.verticalCenter
98 width: nameText.height + 4
104 anchors.leftMargin: 5
105 anchors.verticalCenter: parent.verticalCenter
120 anchors.bottom: parent.bottom
121 anchors.top: dictList.bottom
126 width: (parent.width - 4) / 4
127 height: buttonsBox.height
128 anchors.left: buttonsBox.left
129 anchors.leftMargin: 4
130 anchors.verticalCenter: parent.verticalCenter
131 textInButton: qsTr("Add")
132 onClicked: addButtonClicked();
137 width: (parent.width - 4) / 4
138 height: buttonsBox.height
139 anchors.left: addButton.right
140 anchors.leftMargin: 4
141 anchors.verticalCenter: parent.verticalCenter
142 textInButton: qsTr("Remove")
144 onClicked: removeButtonClicked();
149 width: (parent.width - 4) / 4
150 height: buttonsBox.height
151 anchors.left: removeButton.right
152 anchors.leftMargin: 4
153 anchors.verticalCenter: parent.verticalCenter
154 textInButton: qsTr("Settings")
156 onClicked: settingsButtonClicked();
161 width: (parent.width - 4) / 4
162 height: buttonsBox.height
163 anchors.left: settingsButton.right
164 anchors.leftMargin: 4
165 anchors.right: buttonsBox.right
166 anchors.rightMargin: 4
167 anchors.verticalCenter: parent.verticalCenter
168 textInButton: qsTr("Save")
169 onClicked: saveButtonClicked()