Uses inverted theme (black background)
[chessclock] / qml / MainPage.qml
1 import QtQuick 1.1
2 import com.meego 1.0
3 import QtQuick 1.0
4
5
6 Page {
7     id: mainPage
8     tools: commonTools
9
10
11
12
13
14
15 //    Label {
16 //        id: label
17 //        anchors.centerIn: parent
18 //        text: qsTr("Hello world!")
19 //        visible: false
20 //    }
21 //    Button{
22 //        anchors.horizontalCenter: parent.horizontalCenter
23 //        anchors.top: label.bottom
24 //        anchors.topMargin: 10
25 //        text: qsTr("Click here!")
26 //        onClicked: newGameDialog.open()
27 //    }
28
29     Image
30     {
31         id: bigLogo
32 //        anchors.fill: parent
33 //        anchors.left: menuList.right
34
35         source: ":/rc/pic/logo.png"
36     }
37
38     ListModel
39     {
40         id: menuModel
41
42         ListElement
43         {
44             name: "Normal clock"
45             askAddition: false
46
47
48         }
49
50         ListElement
51         {
52             name: "Addition before"
53             askAddition: true
54         }
55
56         ListElement
57         {
58             name: "Addition after"
59             askAddition: true
60         }
61
62         ListElement
63         {
64             name: "Delay"
65             askAddition: true
66         }
67
68         ListElement
69         {
70             name: "Delay after"
71             askAddition: true
72         }
73
74         ListElement
75         {
76             name:"Hour Glass"
77             askAddition: false
78         }
79
80     }
81
82
83     ListView
84     {
85         id: menuList
86
87         anchors.left: bigLogo.right
88         anchors.right: parent.right
89         anchors.top: parent.top
90         anchors.bottom: parent.bottom
91
92
93          model: menuModel
94
95          delegate: Text
96          {
97              text: name
98              font.pointSize: 40
99              anchors.topMargin: 12
100              color: "white"
101
102             MouseArea
103             {
104                 anchors.fill: parent
105                 onClicked: {newGameDialog.name = name; newGameDialog.askAddition = askAddition; newGameDialog.open()}
106             }
107         }
108
109     }
110
111
112
113
114
115     Dialog
116     {
117         id:newGameDialog
118
119         property string name
120         property bool askAddition
121
122
123
124
125         title:Label
126         {
127             color:"white"
128             font.pointSize: 40
129             text: newGameDialog.name
130         }
131
132
133         content:
134             Grid
135             {
136                 columns: 3
137
138                 Row
139                 {
140                     id: rowRow
141                     spacing: 10
142 //                    anchors.top: parent.top
143 //                    anchors.horizontalCenter: parent.horizontalCenter
144
145                     Text
146                     {
147  //                     width: rowRow.width - rowRow.spacing - switchComponent.width - whiteSmall.width - blackSmall.width
148  //                     height: switchComponent.height
149                         verticalAlignment: Text.AlignVCenter
150                         text: "Equal times"
151                         color: "white"
152                         font.pointSize: 26
153                     }
154
155                     Switch
156                     {
157                         id: switchComponent
158                     }
159                 }
160                 Image
161                 {
162                     id: whiteSmall
163                     source: ":/rc/pic/white_small.png"
164                 }
165
166                 Image
167                 {
168                     id: blackSmall
169                     source: ":/rc/pic/black_small.png"
170                 }
171
172                 Text
173                 {
174                     id: initialTimeText
175                     text: "Initial time"
176                     color: "white"
177                     font.pointSize: 26
178 //                    anchors.top: rowRow.bottom
179 //                    anchors.horizontalCenter: parent.horizontalCenter
180 //                    visible: true
181                 }
182
183                 Text
184                 {
185                     id: additionalTimeText
186                     text: "Additional time"
187                     color: "white"
188                     font.pointSize: 26
189 //                    visible: newGameDialog.askAddition
190 //                    anchors.top: initialTimeText.bottom
191 //                    anchors.horizontalCenter: parent.horizontalCenter
192                 }
193
194                 Text
195                 {
196                     text:  "Turns per addition"
197                     color: "white"
198                     font.pointSize: 26
199 //                    visible: newGameDialog.askAddition
200 //                    anchors.top: additionalTimeText.bottom
201 //                    anchors.horizontalCenter: parent.horizontalCenter
202                 }
203     }
204
205
206         buttons:
207
208             Button
209             {
210                 id: bOk
211                 text: "Start game"
212                 y: 170
213
214                 onClicked: newGameDialog.accept()
215             }
216     }
217
218 }
219
220