|
@@ -33,11 +33,11 @@ ApplicationWindow {
|
|
|
id: root
|
|
|
visible: true
|
|
|
property int tileSize: 20
|
|
|
- width: field.width*tileSize
|
|
|
+ width: field.width*tileSize + sideBar.width
|
|
|
height: field.height*tileSize
|
|
|
|
|
|
Rectangle {
|
|
|
- color: "#000000"
|
|
|
+ color: "#565656"
|
|
|
anchors.fill: parent
|
|
|
}
|
|
|
|
|
@@ -53,34 +53,61 @@ ApplicationWindow {
|
|
|
}
|
|
|
|
|
|
Rectangle {
|
|
|
- color: "#eeffee"
|
|
|
+ color: "#99ee99"
|
|
|
x: field.food.x*tileSize
|
|
|
y: field.food.y*tileSize
|
|
|
width: tileSize
|
|
|
height: tileSize
|
|
|
}
|
|
|
|
|
|
- Column {
|
|
|
+ Rectangle {
|
|
|
+ id: sideBar
|
|
|
+ width: speedTextField.width + contentColumn.anchors.margins*2
|
|
|
+ color: "#000000"
|
|
|
anchors {
|
|
|
right: parent.right
|
|
|
top: parent.top
|
|
|
- margins: 10
|
|
|
- }
|
|
|
- Text {
|
|
|
- color: "#ddffee"
|
|
|
- text: "Generation: " + stats.generation
|
|
|
- }
|
|
|
- Text {
|
|
|
- color: "#ddffee"
|
|
|
- text: "Individual: " + stats.individual
|
|
|
- }
|
|
|
- Text {
|
|
|
- color: "#ddffee"
|
|
|
- text: "Move: " + stats.move
|
|
|
+ bottom: parent.bottom
|
|
|
}
|
|
|
- TextField {
|
|
|
- onAccepted: {
|
|
|
- client.setSpeed(parseInt(text, 10))
|
|
|
+ Column {
|
|
|
+ id: contentColumn
|
|
|
+ anchors.fill: parent
|
|
|
+ anchors.margins: 10
|
|
|
+ spacing: 10
|
|
|
+ Text {
|
|
|
+ font.pointSize: 14
|
|
|
+ font.weight: Font.Bold
|
|
|
+ color: "#ffffff"
|
|
|
+ text: "Generation: " + stats.generation
|
|
|
+ }
|
|
|
+ Text {
|
|
|
+ font.pointSize: 14
|
|
|
+ font.weight: Font.Bold
|
|
|
+ color: "#ffffff"
|
|
|
+ text: "Individual: " + stats.individual
|
|
|
+ }
|
|
|
+ Text {
|
|
|
+ font.pointSize: 14
|
|
|
+ font.weight: Font.Bold
|
|
|
+ color: "#ffffff"
|
|
|
+ text: "Move: " + stats.move
|
|
|
+ }
|
|
|
+ Text {
|
|
|
+ font.pointSize: 14
|
|
|
+ font.weight: Font.Bold
|
|
|
+ color: "#ffffff"
|
|
|
+ text: "Speed: "
|
|
|
+ }
|
|
|
+ TextField {
|
|
|
+ id: speedTextField
|
|
|
+ font.pointSize: 14
|
|
|
+ validator: RegExpValidator {
|
|
|
+ regExp: /1?[0-9]{1}/
|
|
|
+ }
|
|
|
+
|
|
|
+ onAccepted: {
|
|
|
+ client.setSpeed(parseInt(text, 10))
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|