touch: Prevent multiple page pushes at the same time
This commit is contained in:
parent
7165800c73
commit
7f620cb505
3 changed files with 20 additions and 4 deletions
|
@ -39,13 +39,16 @@ MouseArea {
|
||||||
}
|
}
|
||||||
|
|
||||||
onPressedChanged: {
|
onPressedChanged: {
|
||||||
|
if (pgst.loadPageInProgress) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (pressed) {
|
if (pressed) {
|
||||||
dragging.stacking.stopAllAnimations();
|
dragging.stacking.stopAllAnimations();
|
||||||
} else {
|
} else {
|
||||||
if (hasPull && parent.x < -parent.width / 4 + 10) {
|
if (hasPull && parent.x < -parent.width / 4 + 10) {
|
||||||
pulled();
|
pulled();
|
||||||
parent.x = -parent.width / 4;
|
parent.x = -parent.width / 4;
|
||||||
//dragging.stacking.fadeInAgain();
|
|
||||||
} else if (parent.x > parent.width / 3) {
|
} else if (parent.x > parent.width / 3) {
|
||||||
dragging.stacking.startFadeOut();
|
dragging.stacking.startFadeOut();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,17 +45,26 @@ Item {
|
||||||
children[index-1].opacity = x / width;
|
children[index-1].opacity = x / width;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
property bool loadPageInProgress: false
|
||||||
|
|
||||||
function loadPage(filename, properties) {
|
function loadPage(filename, properties) {
|
||||||
|
if (pgst.loadPageInProgress) {
|
||||||
|
console.log('ignoring loadPage request while load in progress');
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
var component = Qt.createComponent(filename);
|
var component = Qt.createComponent(filename);
|
||||||
if (component.status != Component.Ready) {
|
if (component.status != Component.Ready) {
|
||||||
console.log('Error loading ' + filename + ':' +
|
console.log('Error loading ' + filename + ':' +
|
||||||
component.errorString());
|
component.errorString());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties === undefined) {
|
if (properties === undefined) {
|
||||||
component.createObject(pgst);
|
properties = {};
|
||||||
} else {
|
|
||||||
component.createObject(pgst, properties);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pgst.loadPageInProgress = true;
|
||||||
|
component.createObject(pgst, properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
PBusyIndicator {
|
PBusyIndicator {
|
||||||
|
|
|
@ -31,6 +31,10 @@ Item {
|
||||||
to: 0
|
to: 0
|
||||||
duration: 500
|
duration: 500
|
||||||
easing.type: Easing.OutCubic
|
easing.type: Easing.OutCubic
|
||||||
|
|
||||||
|
onStopped: {
|
||||||
|
pgst.loadPageInProgress = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PropertyAnimation {
|
PropertyAnimation {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue