From f276cad6329ab9741b035760b033a0a272577bfd Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Fri, 17 Feb 2012 14:00:27 +1000 Subject: optimize some gestures more. stop colliding. Change-Id: I77580905f460e87cc796df66f5cdf02156b7cca6 Reviewed-by: Lorn Potter --- examples/sensors/shakeit/shakeit.qml | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'examples') 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; } @@ -139,6 +139,19 @@ Rectangle { y:triangle2.y + triangle2.height; } }, + 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; @@ -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") { -- cgit v1.2.3