updated design of column

This commit is contained in:
Max Grützner 2018-12-23 10:12:47 +01:00
parent 5983bf0fe9
commit c642b012b5
1 changed files with 44 additions and 26 deletions

View File

@ -13,9 +13,12 @@ Page {
color: settings.theme("PageBackgroundColor")
}
property int itemHeight: heading.height + tickIntervalInfo.height + tickInterval.height + numCountInfo.height + numCount.height + minInfo.height + min.height + maxInfo.height + max.height + startButton.height
property int columnItems: 10
Column {
id: column
spacing: height / 40
spacing: (column.height - itemHeight) / columnItems
width: parent.width
anchors.fill: parent
anchors.topMargin: parent.height * 0.02
@ -23,14 +26,11 @@ Page {
Label {
id: heading
font.pixelSize: parent.width * 0.075
font.pixelSize: parent.width * 0.125
text: "Calculator"
color: settings.theme("PageTextColor")
anchors {
left: parent.left
right: parent.right
leftMargin: parent.width * 0.05
rightMargin: parent.width * 0.05
horizontalCenter: parent.horizontalCenter
}
}
@ -39,7 +39,9 @@ Page {
text: "Interval:"
color: settings.theme("PageTextColor")
font.pixelSize: parent.height * 0.05
Layout.leftMargin: parent.width * 0.05
anchors {
horizontalCenter: parent.horizontalCenter
}
}
@ -63,7 +65,9 @@ Page {
text: "Summands:"
font.pixelSize: parent.height * 0.05
color: settings.theme("PageTextColor")
Layout.leftMargin: parent.width * 0.05
anchors {
horizontalCenter: parent.horizontalCenter
}
}
TextField {
@ -72,9 +76,12 @@ Page {
placeholderText: "summands"
validator: IntValidator {bottom: 1; top: 100000;}
horizontalAlignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: parent.width * 0.05
Layout.rightMargin: parent.width * 0.05
anchors {
left: parent.left
right: parent.right
leftMargin: parent.width * 0.05
rightMargin: parent.width * 0.05
}
Keys.onReturnPressed: root.start()
}
@ -83,7 +90,9 @@ Page {
text: "Minimum:"
font.pixelSize: parent.height * 0.05
color: settings.theme("PageTextColor")
Layout.leftMargin: parent.width * 0.05
anchors {
horizontalCenter: parent.horizontalCenter
}
}
TextField {
@ -92,9 +101,12 @@ Page {
placeholderText: "minimum"
validator: IntValidator {bottom: -100000; top: 100000;}
horizontalAlignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: parent.width * 0.05
Layout.rightMargin: parent.width * 0.05
anchors {
left: parent.left
right: parent.right
leftMargin: parent.width * 0.05
rightMargin: parent.width * 0.05
}
Keys.onReturnPressed: root.start()
}
@ -103,7 +115,9 @@ Page {
text: "Maximum:"
font.pixelSize: parent.height * 0.05
color: settings.theme("PageTextColor")
Layout.leftMargin: parent.width * 0.05
anchors {
horizontalCenter: parent.horizontalCenter
}
}
TextField {
@ -112,21 +126,25 @@ Page {
placeholderText: "maximum"
validator: IntValidator {bottom: -100000; top: 100000;}
horizontalAlignment: Qt.AlignHCenter
Layout.fillWidth: true
Layout.leftMargin: parent.width * 0.05
Layout.rightMargin: parent.width * 0.05
Keys.onReturnPressed: root.start()
anchors {
left: parent.left
right: parent.right
leftMargin: parent.width * 0.05
rightMargin: parent.width * 0.05
}
}
RoundButton {
GameButton {
id: startButton
text: "start"
height: parent.width * 0.1
//width: height
//font.pixelSize: parent.width * 0.03
Layout.fillWidth: true
Layout.leftMargin: parent.width * 0.05
Layout.rightMargin: parent.width * 0.05
font.pixelSize: parent.width * 0.075
anchors {
left: parent.left
right: parent.right
leftMargin: parent.width * 0.05
rightMargin: parent.width * 0.05
}
onClicked: {
root.start()
}