updated design of column

This commit is contained in:
Max Grützner 2018-12-23 10:12:47 +01:00
parent 5983bf0fe9
commit c642b012b5

View file

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