-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnd.qml
131 lines (84 loc) · 2.47 KB
/
End.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
import QtQuick 2.5
Item {
property color mainColor: "#FF0"
property color backgroundColor: "#050505"
property color buttonColor: "#151500"
property color buttonBorderColor: "#555500"
property color buttonHoverColor: "#353500"
property color buttonClickColor: "#252500"
// "Again" cell clicked
signal clicked
// "Noughts WIN" result page
function noughtWin() {
mainText.text = qsTr("Noughts<br>WINS")
mainColor = "#0F0"
buttonColor = "#001500"
buttonBorderColor = "#00FF00"
buttonHoverColor = "#003500"
buttonClickColor = "#002500"
}
// "Crosses WIN" result page
function crossWin() {
mainText.text = qsTr("Crosses<br>WINS")
mainColor = "#F00"
buttonColor = "#150000"
buttonBorderColor = "#FF0000"
buttonHoverColor = "#350000"
buttonClickColor = "#250000"
}
// "DRAW" result page
function draw() {
mainText.text = qsTr("Try again!<br>DRAW")
mainColor = "#FF0"
buttonColor = "#151500"
buttonBorderColor = "#FF0"
buttonHoverColor = "#353500"
buttonClickColor = "#252500"
}
id: end
x: 0
y: 0
width: 400
height: 400
Rectangle {
id: background
anchors.fill: parent
color: backgroundColor
smooth: true
}
Text {
id: mainText
anchors.top: parent.top
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 20
horizontalAlignment: Text.AlignHCenter
textFormat: Text.RichText
text: qsTr("Try again!<br>DRAW")
color: mainColor
style: Text.Raised
styleColor: "#FFF"
font {
family: "Arial"
bold: true
pixelSize: 74
}
antialiasing: true
smooth: true
}
Cell {
id: againCell
anchors.top: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
anchors.topMargin: 20
cellSymbol: qsTr("↺")
textColor: mainColor
borderColor: buttonBorderColor
backgroundColor: buttonColor
hoverColor: buttonHoverColor
clickedColor: buttonClickColor
onClicked: {
// "Again" cell clicked
end.clicked()
}
}
}