add history widget
[mdictionary] / src / mdictionary / qml / StarDictDialog.qml
1 import Qt 4.7
2
3 Rectangle{
4     property bool newPlugin:false;
5
6     function setInfo(string){
7         textInfo.text = string;
8     }
9     function setPath(string){
10         textPath.text = string;
11     }
12     function setButtonText(string){
13         saveButton.textInButton=string;
14     }
15     function setNew(bool){
16         newPlugin=bool;
17     }
18
19     signal saveButtonClicked();
20     signal browseButtonClicked();
21     signal heightChange(int intiger);
22
23     id:rectangle1
24     width: 220
25     height: newPlugin ? textPath.height+50 : textInfo.height+50
26
27     onHeightChanged:{
28         heightChange((newPlugin ? textPath.height+50 : textInfo.height+50));
29         //console.log( "debug" + (newPlugin ? textPath.paintedHeight+55 : textInfo.paintedHeight+55));
30     }
31
32
33
34     SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
35     color : myPalette.window;
36
37
38     Text {
39         id: textInfo
40         text: "Tekst: "
41         height: paintedHeight+5;
42         anchors.right: parent.right
43         anchors.left: parent.left
44         anchors.top: parent.top
45         wrapMode: Text.Wrap;
46         transformOrigin: Item.Left
47         font.pixelSize: 12
48     }
49
50     Text {
51         id: textPath
52         text: qsTr("Dictionary file: not selected")
53         height: paintedHeight+5;
54         anchors.top: parent.top
55         anchors.right: browseButton.left
56         anchors.left: parent.left
57         wrapMode: Text.Wrap;
58         transformOrigin: Item.Left
59         font.pixelSize: 12
60         opacity: 0
61     }
62
63     Button {
64         id: browseButton
65         width: 80;
66         height: 25;
67         textInButton: qsTr("Browse");
68         anchors.top: parent.top
69         anchors.topMargin: 10
70         anchors.right: parent.right
71         opacity: 0
72         onClicked: rectangle1.browseButtonClicked();
73     }
74
75     Button {
76         id: saveButton
77         height: 30
78         anchors.bottom: parent.bottom
79         textInButton: qsTr("Save")
80         anchors.right: parent.right
81         anchors.left: parent.left
82         onClicked: rectangle1.saveButtonClicked();
83     }
84
85     states: [
86         State {
87             name: "new"
88             when: newPlugin==true
89             PropertyChanges { target: textInfo; opacity: 0}
90             PropertyChanges { target: textPath; opacity: 1}
91             PropertyChanges { target: browseButton; opacity: 1 }
92         }
93     ]
94 }