diff --git a/touch/Dragging.qml b/touch/Dragging.qml index 7c94ebd..12df2b0 100644 --- a/touch/Dragging.qml +++ b/touch/Dragging.qml @@ -39,13 +39,16 @@ MouseArea { } onPressedChanged: { + if (pgst.loadPageInProgress) { + return; + } + if (pressed) { dragging.stacking.stopAllAnimations(); } else { if (hasPull && parent.x < -parent.width / 4 + 10) { pulled(); parent.x = -parent.width / 4; - //dragging.stacking.fadeInAgain(); } else if (parent.x > parent.width / 3) { dragging.stacking.startFadeOut(); } else { diff --git a/touch/Main.qml b/touch/Main.qml index 9787ac5..4f68b17 100644 --- a/touch/Main.qml +++ b/touch/Main.qml @@ -45,17 +45,26 @@ Item { children[index-1].opacity = x / width; } + property bool loadPageInProgress: false + function loadPage(filename, properties) { + if (pgst.loadPageInProgress) { + console.log('ignoring loadPage request while load in progress'); + return; + } + var component = Qt.createComponent(filename); if (component.status != Component.Ready) { console.log('Error loading ' + filename + ':' + component.errorString()); } + if (properties === undefined) { - component.createObject(pgst); - } else { - component.createObject(pgst, properties); + properties = {}; } + + pgst.loadPageInProgress = true; + component.createObject(pgst, properties); } PBusyIndicator { diff --git a/touch/Stacking.qml b/touch/Stacking.qml index ce856c3..65000f8 100644 --- a/touch/Stacking.qml +++ b/touch/Stacking.qml @@ -31,6 +31,10 @@ Item { to: 0 duration: 500 easing.type: Easing.OutCubic + + onStopped: { + pgst.loadPageInProgress = false; + } } PropertyAnimation {