diff options
author | Lorn Potter <lorn.potter@nokia.com> | 2012-02-17 14:00:27 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-02-21 05:46:26 +0100 |
commit | f276cad6329ab9741b035760b033a0a272577bfd (patch) | |
tree | dc55218c0ac6e496da22ec701fe7c3162928939a /examples | |
parent | af7bddb5dd6c41c05d4182dd36b0cf4a1718ac54 (diff) | |
download | qtsensors-f276cad6329ab9741b035760b033a0a272577bfd.tar.gz |
optimize some gestures more. stop colliding.
Change-Id: I77580905f460e87cc796df66f5cdf02156b7cca6
Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
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") { |