qwp Initial release
[qwp] / qml / qwp / content / Config.qml
1 import QtQuick 1.0
2
3 ShadowRectangle {
4     y: parent.height
5     anchors.horizontalCenter: parent.horizontalCenter
6     opacity: 1
7     width: parent.width
8     height: wrappersc.height
9  /*   gradient: Gradient {
10         GradientStop {
11             position: 0 */
12             color: "#7d7b97"
13 /*        }
14
15         GradientStop {
16             position: 1
17             color: "#313f4d"
18         }
19     } */
20 //    border.color: "black"
21 //    border.width: 2
22     /*
23     MouseArea {
24         anchors.fill: parent
25         onClicked: { fond.state = '' }
26     }
27     /*
28     Text {
29         id: text2
30         height: 20
31         text: "Panneau gauche"
32         anchors.right: parent.right
33         anchors.rightMargin: 5
34         font.pixelSize: 12
35         anchors.top: parent.top
36         anchors.topMargin: 5
37     }
38
39     TextInput {
40         id: cfgType
41         x: 151
42         y: 76
43         width: 80
44         height: 20
45         text: "new|edit"
46         font.pixelSize: 12
47     }
48 */
49
50
51
52     Flow {
53         id: wrappersc
54         flow: Flow.TopToBottom
55         //width: menu.width-10
56         anchors.horizontalCenter: parent.horizontalCenter
57         anchors.verticalCenter: parent.verticalCenter
58         spacing:  10
59         anchors.bottomMargin: 5
60         anchors.topMargin: 5
61         Text {
62             text: "Language:"
63             //font.pixelSize: 16;
64             font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
65             horizontalAlignment: Qt.AlignRight
66         }
67         Input{
68             id: fromIn
69             KeyNavigation.backtab: searchbutton
70             KeyNavigation.tab:phraseIn
71             onAccepted:searchbutton.doSearch();
72             focus: true
73             text: schModel.from
74         }
75         /*
76         Text {
77             text: "In reply to:"
78             font.pixelSize: 16; font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
79             horizontalAlignment: Qt.AlignRight
80         }
81         Input{
82             id: toIn
83             KeyNavigation.backtab: fromIn
84             KeyNavigation.tab:phraseIn
85             onAccepted:searchbutton.doSearch();
86         } */
87         Text {
88             text: "Search:"
89             //font.pixelSize: 16;
90             font.bold: true; color: "white"; style: Text.Raised; styleColor: "black"
91             horizontalAlignment: Qt.AlignRight
92         }
93         Input{
94             id: phraseIn
95             KeyNavigation.backtab: fromIn
96             KeyNavigation.tab:searchbutton
97             onAccepted:searchbutton.doSearch();
98             text: schModel.phrase
99         }
100
101
102
103
104     Button {
105         x: 2
106         width: menu.width-4
107         height: menu.height
108         id: searchbutton
109         keyUsing: true;
110         opacity: 1
111         text: "Go"
112         KeyNavigation.tab: fromIn
113         Keys.onReturnPressed: searchbutton.doSearch();
114         Keys.onEnterPressed: searchbutton.doSearch();
115         Keys.onSelectPressed: searchbutton.doSearch();
116         Keys.onSpacePressed: searchbutton.doSearch();
117         onClicked: searchbutton.doSearch();
118
119         function doSearch() {
120             // Search ! allowed
121             if (wrappersc.state=="invalidinput")
122                 return;
123
124                 schModel.from=fromIn.text;
125                 //schModel.to= toIn.text;
126                 schModel.phrase = phraseIn.text;
127                 fond.focus = true;
128                 fond.state = ""
129
130         }
131     }
132     }
133 /*
134     states:
135         State {
136         name: "invalidinput"
137         when: fromIn.text=="" && toIn.text=="" && phraseIn.text==""
138         PropertyChanges { target: searchbutton ; opacity: 0.6 ; }
139     } */
140     transitions:
141         Transition {
142         NumberAnimation { target: searchbutton; property: "opacity"; duration: 200 }
143     }
144 }
145
146
147
148