Commit 064be470 authored by Timothée Giet's avatar Timothée Giet
Browse files

chess, improve controls position

now it looks even better,
and improve the situation in the corner-case explained in previous commit's comment
parent 7fb96144
...@@ -243,9 +243,18 @@ ActivityBase { ...@@ -243,9 +243,18 @@ ActivityBase {
anchors.horizontalCenter: background.horizontalCenter anchors.horizontalCenter: background.horizontalCenter
} }
Rectangle {
id: controlsArea
anchors.left: background.left
anchors.right: boardBg.left
anchors.top: boardBg.top
anchors.bottom: boardBg.bottom
opacity: 0
}
states: [ states: [
State { State {
name: "portaitLayout"; when: items.isPortrait name: "portraitLayout"; when: items.isPortrait
PropertyChanges { PropertyChanges {
target: layoutArea target: layoutArea
width: background.width * 0.86 width: background.width * 0.86
...@@ -257,6 +266,7 @@ ActivityBase { ...@@ -257,6 +266,7 @@ ActivityBase {
height: controls.buttonSize * 1.2 height: controls.buttonSize * 1.2
anchors.leftMargin: controls.spacing * 0.5 anchors.leftMargin: controls.spacing * 0.5
anchors.topMargin: 0 anchors.topMargin: 0
anchors.horizontalCenterOffset: 0
} }
AnchorChanges { AnchorChanges {
target: layoutArea target: layoutArea
...@@ -265,8 +275,8 @@ ActivityBase { ...@@ -265,8 +275,8 @@ ActivityBase {
AnchorChanges { AnchorChanges {
target: controls target: controls
anchors.top: textMessage.bottom anchors.top: textMessage.bottom
anchors.horizontalCenter: undefined
anchors.left: boardBg.left anchors.left: boardBg.left
anchors.right: undefined
} }
}, },
State { State {
...@@ -282,6 +292,7 @@ ActivityBase { ...@@ -282,6 +292,7 @@ ActivityBase {
height: layoutArea.height height: layoutArea.height
anchors.leftMargin: 0 anchors.leftMargin: 0
anchors.topMargin: controls.spacing * 0.5 anchors.topMargin: controls.spacing * 0.5
anchors.horizontalCenterOffset: items.cellSize * 0.8
} }
AnchorChanges { AnchorChanges {
target: layoutArea target: layoutArea
...@@ -289,9 +300,9 @@ ActivityBase { ...@@ -289,9 +300,9 @@ ActivityBase {
} }
AnchorChanges { AnchorChanges {
target: controls target: controls
anchors.top: boardBg.top anchors.top: controlsArea.top
anchors.horizontalCenter: controlsArea.horizontalCenter
anchors.left: undefined anchors.left: undefined
anchors.right: boardBg.left
} }
} }
] ]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment