summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLasse Räihä <lasse.raiha@digia.com>2013-05-31 10:51:08 +0300
committerKimmo Ollila <kimmo.ollila@digia.com>2013-05-31 10:52:20 +0300
commitd3c7e010bb5cf2f18c89f58efa61552fa2985c22 (patch)
tree912987f78062960bc2bc9fe9afc09f0b7803813f
parent968ec47f24ccb7932e29fdd518692377410ce146 (diff)
Fixed a bug when user navigate very fast.
Change-Id: Ib612fb1c8a67ed0f3a66bbc21e6f6dc283cbd9db Reviewed-by: Kimmo Ollila <kimmo.ollila@digia.com>
-rw-r--r--QtDemo/qml/QtDemo/WorldCanvas.qml4
-rw-r--r--QtDemo/qml/QtDemo/main.qml16
2 files changed, 14 insertions, 6 deletions
diff --git a/QtDemo/qml/QtDemo/WorldCanvas.qml b/QtDemo/qml/QtDemo/WorldCanvas.qml
index 563239b..95a8a1e 100644
--- a/QtDemo/qml/QtDemo/WorldCanvas.qml
+++ b/QtDemo/qml/QtDemo/WorldCanvas.qml
@@ -51,11 +51,11 @@ Item{
function goNext() {
goTo(app.getNext(), false);
- navigationAnimation.restart()
+ navigationAnimation.restartAnimation()
}
function goPrevious() {
goTo(app.getPrevious(), false);
- navigationAnimation.restart()
+ navigationAnimation.restartAnimation()
}
function goBack()
diff --git a/QtDemo/qml/QtDemo/main.qml b/QtDemo/qml/QtDemo/main.qml
index a143dfa..40371a7 100644
--- a/QtDemo/qml/QtDemo/main.qml
+++ b/QtDemo/qml/QtDemo/main.qml
@@ -132,6 +132,13 @@ Rectangle{
SequentialAnimation {
id: navigationAnimation
+ property int animCounter: 0
+
+ function restartAnimation() {
+ navigationAnimation.animCounter++;
+ restart();
+ }
+
NumberAnimation {
id: zoomOutAnimation
target: canvas;
@@ -151,10 +158,11 @@ Rectangle{
}
onRunningChanged: {
- if (!running) {
- if (navigationState === 2)
- Engine.loadCurrentDemo();
- }
+ if (!running)
+ animCounter--
+
+ if (animCounter === 0 && navigationState === 2)
+ Engine.loadCurrentDemo();
}
}