29 property variant colours: [
"#ea7025",
"#67c111",
"#00bde3",
"#bde300",
"#e3004c"]
30 property variant numbers: [0,1,2,3,4]
31 property string answer:
""
32 property bool answerFlag:
false
33 property var leftPanelComponent: leftPanel
34 property var rightPanelComponent: rightPanel
35 property var backspaceButtonComponent:backspaceButton
36 property int maxDigit: 2
54 height: parent.height/5
56 border.color: Qt.darker(color)
60 anchors.horizontalCenter: parent.horizontalCenter
61 anchors.verticalCenter: parent.verticalCenter
75 width: parent.width * 2
77 containerPanel.opacity > 0
80 if(answer.length < maxDigit)
81 answer += numbers[index]
84 leftPanel.children[index].color = Qt.lighter(colours[index])
85 leftPanel.children[index].border.width = 5
88 leftPanel.children[index].color = colours[index]
89 leftPanel.children[index].border.width = 2
102 x: parent.width - columnWidth
110 height: parent.height/5
111 color: colours[index]
112 border.color: Qt.darker(color)
116 anchors.horizontalCenter: parent.horizontalCenter
117 anchors.verticalCenter: parent.verticalCenter
118 text: numbers[index] + 5
128 bottom: parent.bottom
130 width: parent.width * 2
132 containerPanel.opacity > 0
135 if(answer.length < maxDigit)
136 answer += numbers[index] + 5
139 rightPanel.children[index].color = Qt.lighter(colours[index])
140 rightPanel.children[index].border.width = 5
143 rightPanel.children[index].color = colours[index]
144 rightPanel.children[index].border.width = 2
152 height: containerPanel.height - rightPanel.height
154 border.color:
"black"
158 anchors.horizontalCenter: parent.horizontalCenter
159 anchors.verticalCenter: parent.verticalCenter
168 containerPanel.opacity > 0
171 answer = answer.substring(0,answer.length - 1)
174 backspaceButton.color = Qt.lighter(
"white")
175 backspaceButton.border.width = 5
179 backspaceButton.color =
"white"
180 backspaceButton.border.width = 2
191 function updateAnswer(key, isKeyPressed){
226 case Qt.Key_Backspace:
230 if(isKeyPressed && !answerFlag)
232 if(keyValue < 5 && answer.length < maxDigit)
236 leftPanel.children[keyValue].color = Qt.lighter(colours[keyValue])
237 leftPanel.children[keyValue].border.width = 5
239 else if(keyValue < 10 && answer.length < maxDigit)
242 rightPanel.children[keyValue - 5].color = Qt.lighter(colours[keyValue - 5])
243 rightPanel.children[keyValue - 5].border.width = 5
245 else if(keyValue === 10)
247 answer = answer.substring(0,answer.length - 1);
248 backspaceButton.color = Qt.lighter(
"white")
249 backspaceButton.border.width = 5
256 leftPanel.children[keyValue].color = colours[keyValue]
257 leftPanel.children[keyValue].border.width = 2
259 else if(keyValue < 10)
262 rightPanel.children[keyValue - 5].color = colours[keyValue - 5]
263 rightPanel.children[keyValue - 5].border.width = 2
265 else if(keyValue === 10)
267 backspaceButton.color =
"white"
268 backspaceButton.border.width = 2
bool isVirtualKeyboard
Whether on-screen keyboard should be enabled per default in activities that use it.
A QML component unifying text presentation in GCompris.
Singleton that contains GCompris' persistent settings.
A general purpose singleton that exposes miscellaneous native functions to the QML layer...
qreal ratio
Ratio factor used for scaling of sizes on high-dpi devices.