mathtrainingstuff/CalculatorEndPage.qml

107 lines
2.5 KiB
QML
Raw Normal View History

import QtQuick 2.11
import QtQuick.Controls 2.4
import "./"
Page {
id: root
signal pageOpened()
2018-11-26 19:33:59 +01:00
TextField {
id: sumInput
placeholderText: "sum"
2018-11-26 20:05:20 +01:00
visible: !endPageVisibility
2018-11-26 19:33:59 +01:00
validator: IntValidator {bottom: -1000000; top: 1000000;}
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: parent.height * 0.1
}
Keys.onReturnPressed: calculator.checkSum(sumInput.text)
}
2018-11-26 20:05:20 +01:00
RoundButton {
id: checkButton
height: parent.width * 0.2
width: height
text: "check"
font.pixelSize: parent.width * 0.03
visible: !endPageVisibility
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: parent.height * 0.3
}
onClicked: {
calculator.checkSum(sumInput.text)
}
}
2018-11-26 19:33:59 +01:00
Label {
id: won
text: calculator.endPageLabelText
font.pixelSize: parent.width * 0.2
visible: calculator.endPageVisibility
anchors {
horizontalCenter: parent.horizontalCenter
top: parent.top
topMargin: parent.height * 0.2
}
}
2018-11-26 19:33:59 +01:00
/*
Row {
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: parent.height * 0.2
}
height: childrenRect.height
width: childrenRect.width
spacing: root.height * 0.1
2018-11-26 19:33:59 +01:00
RoundButton {
id: homeButton
height: parent.width * 0.2
width: height
text: "home"
onClicked: {
game.state = "starting"
calculator.reset()
}
}
2018-11-26 19:33:59 +01:00
RoundButton {
id: startButtons
height: parent.width * 0.2
width: height
text: "start"
onClicked: {
calculator.reset()
calculator.state = "starting"
}
}
2018-11-26 19:33:59 +01:00
}
*/
2018-11-26 19:33:59 +01:00
RoundButton {
id: homeButton
height: parent.width * 0.2
width: height
text: "home"
2018-11-26 20:05:20 +01:00
font.pixelSize: parent.width * 0.03
2018-11-26 19:33:59 +01:00
visible: endPageVisibility
anchors {
horizontalCenter: parent.horizontalCenter
bottom: parent.bottom
bottomMargin: parent.height * 0.1
}
2018-11-26 19:33:59 +01:00
onClicked: {
calculator.reset()
calculator.state = "starting"
}
}
2018-11-26 20:05:20 +01:00
}