Changeset View
Changeset View
Standalone View
Standalone View
src/activities/leftright/Leftright.qml
Show First 20 Lines • Show All 64 Lines • ▼ Show 20 Line(s) | 64 | Item { | |||
---|---|---|---|---|---|
65 | id: topBorder | 65 | id: topBorder | ||
66 | height: background.height * 0.08 | 66 | height: background.height * 0.08 | ||
67 | } | 67 | } | ||
68 | 68 | | |||
69 | Image { | 69 | Image { | ||
70 | id: blackBoard | 70 | id: blackBoard | ||
71 | anchors.horizontalCenter: parent.horizontalCenter | 71 | anchors.horizontalCenter: parent.horizontalCenter | ||
72 | anchors.top: topBorder.bottom | 72 | anchors.top: topBorder.bottom | ||
73 | anchors.topMargin: 20 | ||||
jjazeix: hardcoding a value is never good when you have the possibility to use anchors.
Here, you want… | |||||
73 | fillMode: Image.PreserveAspectFit | 74 | fillMode: Image.PreserveAspectFit | ||
74 | sourceSize.width: Math.min(background.width, | 75 | sourceSize.width: Math.min(background.width, | ||
75 | (background.height - leftButton.height - bar.height) * 1.3) | 76 | (background.height - leftButton.height - bar.height) * 1.3) | ||
76 | source: "qrc:/gcompris/src/activities/leftright/resource/blackboard.svg" | 77 | source: "qrc:/gcompris/src/activities/leftright/resource/blackboard.svg" | ||
77 | 78 | | |||
78 | Image { | 79 | Image { | ||
79 | id: handImage | 80 | id: handImage | ||
80 | anchors.horizontalCenter: parent.horizontalCenter | 81 | anchors.horizontalCenter: parent.horizontalCenter | ||
▲ Show 20 Lines • Show All 109 Lines • ▼ Show 20 Line(s) | 190 | Bonus { | |||
190 | id: bonus | 191 | id: bonus | ||
191 | onStart: items.buttonsBlocked = true | 192 | onStart: items.buttonsBlocked = true | ||
192 | onStop: items.buttonsBlocked = false | 193 | onStop: items.buttonsBlocked = false | ||
193 | } | 194 | } | ||
194 | 195 | | |||
195 | Score { | 196 | Score { | ||
196 | id: score | 197 | id: score | ||
197 | anchors.top: background.top | 198 | anchors.top: background.top | ||
199 | anchors.topMargin: parent.height * 0.01 | ||||
198 | anchors.bottom: undefined | 200 | anchors.bottom: undefined | ||
199 | } | 201 | } | ||
200 | } | 202 | } | ||
201 | } | 203 | } |
hardcoding a value is never good when you have the possibility to use anchors.
Here, you want to have the blackboard below the score, so let's just put the score bottom as blackboard top anchor.