summaryrefslogtreecommitdiffstats
path: root/examples/sensors/shakeit
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@nokia.com>2012-02-17 14:00:27 +1000
committerQt by Nokia <qt-info@nokia.com>2012-02-21 05:46:26 +0100
commitf276cad6329ab9741b035760b033a0a272577bfd (patch)
treedc55218c0ac6e496da22ec701fe7c3162928939a /examples/sensors/shakeit
parentaf7bddb5dd6c41c05d4182dd36b0cf4a1718ac54 (diff)
optimize some gestures more. stop colliding.
Change-Id: I77580905f460e87cc796df66f5cdf02156b7cca6 Reviewed-by: Lorn Potter <lorn.potter@nokia.com>
Diffstat (limited to 'examples/sensors/shakeit')
-rw-r--r--examples/sensors/shakeit/shakeit.qml21
1 files changed, 19 insertions, 2 deletions
diff --git a/examples/sensors/shakeit/shakeit.qml b/examples/sensors/shakeit/shakeit.qml
index 25b78bc5..f553b935 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") {