summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-08-23 14:18:42 +0200
committerThomas Hartmann <Thomas.Hartmann@theqtcompany.com>2016-09-02 07:25:08 +0000
commita327d55aec8feec5ea6bc147f08d71c0dc1341cb (patch)
tree7a3ce96d40b59ff4119d52a3b96acffdd3eb66a2 /examples
parent7c3787a8cec5e6c137107737ae4ae8f63fb724d7 (diff)
Examples: minor cleanup
* Use Column to simplify layout * Changing opacity instead of visible Change-Id: I6468f25a1a4e0c55eb20645147c2a422dd0f2f52 Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/scxml/trafficlight-common/TrafficLight.qml38
1 files changed, 19 insertions, 19 deletions
diff --git a/examples/scxml/trafficlight-common/TrafficLight.qml b/examples/scxml/trafficlight-common/TrafficLight.qml
index 9ae08e6..ff4325a 100644
--- a/examples/scxml/trafficlight-common/TrafficLight.qml
+++ b/examples/scxml/trafficlight-common/TrafficLight.qml
@@ -71,28 +71,28 @@ Window {
}
}
- Image {
- id: redLight
- x: (lights.width - width) / 2
+ Column {
y: 40
- source: "red.png"
- visible: stateMachine.red || stateMachine.redGoingGreen
- }
+ spacing: 27
+ anchors.horizontalCenter: parent.horizontalCenter
- Image {
- id: yellowLight
- x: (lights.width - width) / 2
- y: 135
- source: "yellow.png"
- visible: stateMachine.yellow || stateMachine.blinking
- }
+ Image {
+ id: redLight
+ source: "red.png"
+ opacity: stateMachine.red || stateMachine.redGoingGreen ? 1 : 0.2
+ }
- Image {
- id: greenLight
- x: (lights.width - width) / 2
- y: 230
- source: "green.png"
- visible: stateMachine.green
+ Image {
+ id: yellowLight
+ source: "yellow.png"
+ opacity: stateMachine.yellow || stateMachine.blinking ? 1 : 0.2
+ }
+
+ Image {
+ id: greenLight
+ source: "green.png"
+ opacity: stateMachine.green ? 1 : 0.2
+ }
}
}