I fixed some other issues that I was having with this app. So I restarted it and this is the new version with no errors and works very nicely.
import QtQuick 2.0
import QtQuick.Window 2.0
import QtQuick.Controls 1.0
GestureArea {
id:main
width: 470
height: 700
property int swiped_direction:1
property bool swiped:false
property int aniSpeed: 90
onSwipeRight: {doRightSwipeProcess()}
onSwipeLeft: {doLeftSwipeProcess()}
states: [
State {
name: "toLeft"
PropertyChanges {target: front;x:(main.width - (main.width/3) + (main.width/24) - 25)}
PropertyChanges {target: front;scale:0.5}
PropertyChanges {target: left;scale:1}
},
State {
name: "toRight"
PropertyChanges {target: front;x:-(main.width - (main.width/3) + (main.width/24) - 25)}
PropertyChanges {target: front;scale:0.5}
PropertyChanges {target: right;scale:1}
}
]
Rectangle{
id:front
width:main.width
height:main.height
property int direction:1
color:"#fff"
Behavior on scale{NumberAnimation{duration:aniSpeed;}}
Behavior on x{NumberAnimation{duration:aniSpeed}}
z:2
}
Image{
id:left
source:"images/app_bg_left.png"
Behavior on scale{NumberAnimation{duration: main.aniSpeed}}
width:main.width
height:main.height
transformOrigin: Item.Right
scale:1.3
anchors.right:{if(scale<1.3){return main.right}else{return main.left}}
z:0
}
Settings{
id:right
//source:"images/app_bg_right.png"
Behavior on scale{NumberAnimation{duration: main.aniSpeed}}
width:main.width
height:main.height
transformOrigin: Item.Left
scale:1.3
anchors.left:{if(scale<1.3){return main.left}else{return main.right}}
z:1
onDoLeftSwipe: doLeftSwipeProcess()
onDoRightSwipe: doRightSwipeProcess()
}
function doRightSwipeProcess(){
//scale to right
if(front.height == main.height && swiped_direction!=0 && swiped_direction!=2)
{main.state = "toLeft";swiped = true;swiped_direction = 0;front.direction = 0}
//back to center from left
else if(swiped && swiped_direction!=0)
{main.state = "";swiped = false;swiped_direction = 1;front.direction = 1;}
}
function doLeftSwipeProcess(){
//scale to left // here is where the righ tbg menu swipe problem lies
if(front.height == main.height && swiped_direction!=2 && swiped_direction!=0)
{main.state = "toRight";swiped = true;swiped_direction = 2;front.direction = 2}
//back to center from right
else if(swiped && swiped_direction!=2)
{main.state = "";main.swiped = false;main.swiped_direction = 1;front.direction = 1}
}
}