New game dialog: Ok button -> Start game button
[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 //    Label {
10 //        id: label
11 //        anchors.centerIn: parent
12 //        text: qsTr("Hello world!")
13 //        visible: false
14 //    }
15 //    Button{
16 //        anchors.horizontalCenter: parent.horizontalCenter
17 //        anchors.top: label.bottom
18 //        anchors.topMargin: 10
19 //        text: qsTr("Click here!")
20 //        onClicked: newGameDialog.open()
21 //    }
22
23     Image
24     {
25         id: bigLogo
26 //        anchors.fill: parent
27 //        anchors.left: menuList.right
28
29         source: ":/rc/pic/logo.png"
30     }
31
32     ListModel
33     {
34         id: menuModel
35
36         ListElement
37         {
38             name: "Normal clock"
39
40
41         }
42
43         ListElement
44         {
45             name: "Addition before"
46         }
47
48         ListElement
49         {
50             name: "Addition after"
51
52
53         }
54
55         ListElement
56         {
57             name: "Delay"
58
59         }
60
61         ListElement
62         {
63             name: "Delay after"
64         }
65
66         ListElement
67         {
68             name:"Hour Glass"
69         }
70
71     }
72
73
74     ListView
75     {
76         id: menuList
77
78         anchors.left: bigLogo.right
79         anchors.right: parent.right
80         anchors.top: parent.top
81         anchors.bottom: parent.bottom
82
83
84          model: menuModel
85
86          delegate: Text
87          {
88              text: name
89              font.pointSize: 40
90              anchors.topMargin: 12
91
92             MouseArea
93             {
94                 anchors.fill: parent
95                 onClicked: {newGameDialog.name = name; newGameDialog.open()}
96             }
97         }
98
99     }
100
101
102
103
104
105     Dialog
106     {
107         id:newGameDialog
108
109         property string name
110
111
112         title:Label
113         {
114             color:"white"
115             font.pointSize: 40
116             text: newGameDialog.name
117         }
118
119
120         content:
121             Row
122             {
123                 id: rowRow
124                 spacing: 10
125                 anchors.fill: parent
126
127                 Text
128                 {
129                   width: rowRow.width - rowRow.spacing - switchComponent.width
130                   height: switchComponent.height
131                   verticalAlignment: Text.AlignVCenter
132                   text: "Equal times"
133                   color: "white"
134                   font.pointSize: 16
135                 }
136
137                 Switch
138                 {
139                     id: switchComponent
140                 }
141
142             }
143
144         buttons:
145
146             Button
147             {
148                 id: bOk
149                 text: "Start game"
150                 y: 170
151
152                 onClicked: newGameDialog.accept()
153             }
154     }
155
156 }
157
158