-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathBoardRightSide.qml
333 lines (325 loc) · 15.4 KB
/
BoardRightSide.qml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
import QtQuick 2.9
import QtQuick.Controls 2.5
import QtQuick.Dialogs 1.2
Item {
Dialog {
id: extraMoveDialog
title: persian.checked ? "حرکت اضافه" : "Extra Move"
Text {
id: extraMoveText
text: ""
}
}
Rectangle {
anchors.fill: parent
color: "white"
Image {
width: parent.width - 2
height: parent.height - 2
id: rightSide
anchors.centerIn: parent
source: "qrc:/Assets/Images/Wood5.jpg"
Text {
id: scoresSideText
text: persian.checked ? "امتیاز ها" : "Scores:"
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 3
font.pixelSize: 20
font.bold: true
color: "#aa882a"
anchors.top: rightSide.top
height: rightSide.height * 0.04
width: rightSide.width * 0.8
anchors.topMargin: 10
anchors.horizontalCenter: rightSide.horizontalCenter
horizontalAlignment: Text.AlignHCenter
}
Column {
id: scoreCol
anchors.top: scoresSideText.bottom
anchors.topMargin: rightSide.height * 0.04
anchors.horizontalCenter: rightSide.horizontalCenter
spacing: rightSide.height * 0.04
//_________________________________________________________________________________ P2 score
Rectangle {
id: scores2Rec
color: "#00000000"
border.color: "#7c6d43"
width: rightSide.width - 10
height: rightSide.height * 0.3
anchors.horizontalCenter: scoreCol.horizontalCenter
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Column {
id: score2Col
anchors.horizontalCenter: scores2Rec.horizontalCenter
anchors.top: scores2Rec.top
anchors.topMargin: scores2Rec.height * 0.05
Rectangle {
id: p2Rec
anchors.horizontalCenter: score2Col.horizontalCenter
border.color: "#7c6d43"
border.width: 1
width: scores2Rec.width * 0.6
height: scores2Rec.height * 0.22
color: "#00000000"
Text {
id: p2
text: bknd.getP2Name()
width: p2Rec.width - 2
height: p2Rec.height - 2
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 18
font.bold: true
color: "#e2d29d"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.centerIn: parent
}
}
Text {
id: p2PositiveScoreText
text: persian.checked ? "امتیاز مثبت" : "Positive score:"
font.bold: true
horizontalAlignment: Text.AlignHCenter
width: scores2Rec.width * 0.6
height: scores2Rec.height * 0.19
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#aa882a"
anchors.horizontalCenter: score2Col.horizontalCenter
topPadding: scores2Rec.height * 0.05
}
Text {
id: p2PositiveScore
text: bknd.getP2_PScore()
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
horizontalAlignment: Text.AlignHCenter
height: scores2Rec.height * 0.18
width: scores2Rec.width * 0.6
color: "#e2d29d"
anchors.horizontalCenter: score2Col.horizontalCenter
}
Text {
id: p2NegativeScoreText
text: persian.checked ? "امتیاز منفی" : "Negative score:"
horizontalAlignment: Text.AlignHCenter
height: scores2Rec.height * 0.18
width: scores2Rec.width * 0.6
font.bold: true
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#aa882a"
anchors.horizontalCenter: score2Col.horizontalCenter
topPadding: scores2Rec.height * 0.05
}
Text {
id: p2NegativeScore
text: bknd.getP2_NScore()
horizontalAlignment: Text.AlignHCenter
height: scores2Rec.height * 0.18
width: scores2Rec.width * 0.6
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#e2d29d"
anchors.horizontalCenter: score2Col.horizontalCenter
}
}
}
//______________________________________________________________________P1 score
Rectangle {
id: scores1Rec
color: "#00000000"
border.color: "#7c6d43"
width: rightSide.width - 10
height: rightSide.height * 0.3
anchors.horizontalCenter: scoreCol.horizontalCenter
Image {
source: "qrc:/Assets/Images/wood1.jpeg"
width: parent.width - 2
height: parent.height - 2
anchors.centerIn: parent
}
Column {
id: score1Col
anchors.horizontalCenter: scores1Rec.horizontalCenter
anchors.top: scores1Rec.top
anchors.topMargin: scores1Rec.height * 0.05
Rectangle {
id: p1Rec
anchors.horizontalCenter: score1Col.horizontalCenter
border.color: "#7c6d43"
border.width: 1
width: scores1Rec.width * 0.6
height: scores1Rec.height * 0.22
color: "#00000000"
Text {
id: p1
text: bknd.getP1Name()
width: p1Rec.width - 2
height: p1Rec.height - 2
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 18
font.bold: true
color: "#e2d29d"
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.centerIn: parent
}
}
Text {
id: p1PositiveScoreText
text: persian.checked ? "امتیاز مثبت" : "Positive score:"
font.bold: true
horizontalAlignment: Text.AlignHCenter
width: scores1Rec.width * 0.6
height: scores1Rec.height * 0.18
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#aa882a"
anchors.horizontalCenter: score1Col.horizontalCenter
topPadding: scores1Rec.height * 0.05
}
Text {
id: p1PositiveScore
text: bknd.getP1_PScore()
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
horizontalAlignment: Text.AlignHCenter
height: scores1Rec.height * 0.18
width: scores1Rec.width * 0.6
color: "#e2d29d"
anchors.horizontalCenter: score1Col.horizontalCenter
}
Text {
id: p1NegativeScoreText
text: persian.checked ? "امتیاز منفی" : "Negative score:"
horizontalAlignment: Text.AlignHCenter
height: scores1Rec.height * 0.18
width: scores1Rec.width * 0.6
font.bold: true
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#aa882a"
anchors.horizontalCenter: score1Col.horizontalCenter
topPadding: scores1Rec.height * 0.05
}
Text {
id: p1NegativeScore
text: bknd.getP1_NScore()
horizontalAlignment: Text.AlignHCenter
height: scores1Rec.height * 0.18
width: scores1Rec.width * 0.6
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 2
font.pixelSize: 15
color: "#e2d29d"
anchors.horizontalCenter: score1Col.horizontalCenter
}
}
}
//extra move
Rectangle {
id: extraMoveRec
color: "#00000000"
border.color: "#7c6d43"
width: rightSide.width * 0.8
height: rightSide.height * 0.07
anchors.horizontalCenter: scoreCol.horizontalCenter
Image {
anchors.centerIn: parent
width: extraMoveRec.width - 2
height: extraMoveRec.height - 2
source: "qrc:/Assets/Images/wood1.jpeg"
Button {
id: extraMove
anchors.fill: parent
flat: true
onClicked: if (bknd.extraMove()) {
extraMoveText.text = persian.checked ? "یک حرکت اضافه گرفتید" : "You got one extra move!"
extraMoveDialog.open()
} else {
extraMoveText.text = persian.checked ? "امتیاز کافی ندارید!" : "Not enough scores!"
extraMoveDialog.open()
}
Text {
text: persian.checked ? "حرکت اضافه" : "Extra Move"
color: "#aa882a"
anchors.centerIn: parent
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 3
font.pixelSize: 15
height: extraMove.height * 0.9
width: extraMove.width * 0.9
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}
//Random move
Rectangle {
id: randomMoveRec
color: "#00000000"
border.color: "#7c6d43"
width: rightSide.width * 0.8
height: rightSide.height * 0.07
anchors.horizontalCenter: scoreCol.horizontalCenter
Image {
anchors.centerIn: parent
width: randomMoveRec.width - 2
height: randomMoveRec.height - 2
source: "qrc:/Assets/Images/wood1.jpeg"
Button {
id: randomMove
anchors.fill: parent
flat: true
onClicked: {
bknd.randomMove()
}
Text {
text: persian.checked ? "حرکت تصادفی" : "Random Move"
color: "#aa882a"
anchors.centerIn: parent
textFormat: Text.StyledText
fontSizeMode: Text.Fit
minimumPixelSize: 3
font.pixelSize: 15
height: randomMove.height * 0.9
width: randomMove.width * 0.9
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
}
}
}
}
}
}
}
}