Skip to content

Commit

Permalink
Love/hate commit for the UI
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Törnqvist committed Jun 21, 2014
1 parent 7b73c54 commit 6b74f4d
Showing 1 changed file with 157 additions and 10 deletions.
167 changes: 157 additions & 10 deletions qml/pages/calc.qml
Expand Up @@ -11,7 +11,7 @@ Page {

SilicaFlickable {
id: calcFlickable
contentHeight: calcColumn.height
contentHeight: header.height + landContainer.height + separator.height + whiteContainer.height + redContainer.height + greenContainer.height + blueContainer.height + blackContainer.height
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
Expand All @@ -23,19 +23,20 @@ Page {
flickable: calcFlickable
}

Column {
id: calcColumn
width: calcPage.width
spacing: Theme.paddingLarge

PageHeader {
title: qsTr("Calculate mana base")
}
PageHeader {
id: header
title: qsTr("Calculate mana base")
}

Item {
id: landContainer
height: landSlider.height + landPlus5.height
anchors.top: header.bottom
anchors.left: parent.left
anchors.right: parent.right
Slider {
id: landSlider // :D
label: qsTr("Land count")
width: calcPage.width
stepSize: 1
minimumValue: MSail.ManaSail.getGameFormat()['minLandCount']
maximumValue: MSail.ManaSail.getGameFormat()['maxLandCount']
Expand All @@ -46,8 +47,38 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: landPlus5.left
anchors.rightMargin: 0
}

Button {
id: landPlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
landSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: landSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}

Separator {
id: separator
anchors.top: landContainer.bottom
}

Item {
id: whiteContainer
height: whiteSlider.height
anchors.top: separator.bottom
anchors.left: parent.left
anchors.right: parent.right

Slider {
id: whiteSlider
label: qsTr("White count")
Expand All @@ -62,7 +93,32 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: whitePlus5.left
anchors.rightMargin: 0
}

Button {
id: whitePlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
whiteSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: whiteSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}

Item {
id: redContainer
height: redSlider.height
anchors.top: whiteContainer.bottom
anchors.left: parent.left
anchors.right: parent.right

Slider {
id: redSlider
Expand All @@ -78,8 +134,33 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: redPlus5.left
anchors.rightMargin: 0
}

Button {
id: redPlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
redSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: redSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}

Item {
id: greenContainer
height: greenSlider.height
anchors.top: redContainer.bottom
anchors.left: parent.left
anchors.right: parent.right

Slider {
id: greenSlider
label: qsTr("Green count")
Expand All @@ -94,8 +175,33 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: greenPlus5.left
anchors.rightMargin: 0
}

Button {
id: greenPlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
greenSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: greenSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}

Item {
id: blueContainer
height: blueSlider.height
anchors.top: greenContainer.bottom
anchors.left: parent.left
anchors.right: parent.right

Slider {
id: blueSlider
label: qsTr("Blue count")
Expand All @@ -110,7 +216,32 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: bluePlus5.left
anchors.rightMargin: 0
}

Button {
id: bluePlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
blueSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: blueSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}

Item {
id: blackContainer
height: blackSlider.height
anchors.top: blueContainer.bottom
anchors.left: parent.left
anchors.right: parent.right

Slider {
id: blackSlider
Expand All @@ -126,8 +257,24 @@ Page {
MSail.ManaSail.calculate();
MSail.ManaSail.display(summary);
}
anchors.top: parent.top
anchors.left: parent.left
anchors.right: blackPlus5.left
anchors.rightMargin: 0
}

Button {
id: blackPlus5
text: "+5"
width: Theme.fontSizeSmall * 2
onClicked: {
blackSlider.maximumValue += 5;
}
anchors.top: parent.top
anchors.topMargin: blackSlider.height / 5
anchors.right: parent.right
anchors.rightMargin: Theme.paddingLarge * 3
}
}
}
Label {
Expand Down

0 comments on commit 6b74f4d

Please sign in to comment.