diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/sensors/shakeit/shakeit.qml | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/examples/sensors/shakeit/shakeit.qml b/examples/sensors/shakeit/shakeit.qml index 25b78bc..f553b93 100644 --- a/examples/sensors/shakeit/shakeit.qml +++ b/examples/sensors/shakeit/shakeit.qml @@ -127,7 +127,7 @@ Rectangle { y: triangle2.y + triangle2.height; } }, State { - name: "twisted" + name: "twistedR" PropertyChanges { target: triangle1; rotation: 270; x:window.width - triangle1.width; } @@ -140,6 +140,19 @@ Rectangle { } }, State { + name: "twistedL" + PropertyChanges { target: triangle1; rotation: 270; + x:0; + } + PropertyChanges { target: triangle2; rotation: 180; + x:0; + } + PropertyChanges { target: triangle3; rotation: 90; + x:0; + y:triangle2.y + triangle2.height; + } + }, + State { name: "covered" PropertyChanges { target: triangle1; rotation: 0; x: window.width / 3 - triangle1.width / 2; @@ -235,7 +248,11 @@ Rectangle { timer.start() } if (gesture == "twistRight") { - window.state == "twisted" ? window.state = "default" : window.state = "twisted" + window.state == "twistedR" ? window.state = "default" : window.state = "twistedR" + timer.start() + } + if (gesture == "twistLeft") { + window.state == "twistedL" ? window.state = "default" : window.state = "twistedL" timer.start() } if (gesture == "cover") { |