fix the swipe out gesture

This commit is contained in:
Marco Martin 2015-09-23 11:54:26 +02:00
parent d3b41afc02
commit 2a0152bad0

View file

@ -38,7 +38,16 @@ Rectangle {
MouseArea {
anchors.fill: parent
onClicked: removeAnim.running = true;
drag.filterChildren: true
drag.target: splitDrawer.open ? null : main
drag.axis: Drag.XAxis
drag.maximumX: 0
onReleased: {
if (main.x < -main.width/3) {
removeAnim.running = true;
} else {
openAnim.running = true;
}
}
NumberAnimation {
@ -98,6 +107,7 @@ Rectangle {
onShouldClose: removeAnim.running = true;
}
MobileComponents.SplitDrawer {
id: splitDrawer
visible: true
anchors.fill: parent
drawer: PlasmaExtras.ScrollArea {
@ -121,19 +131,7 @@ Rectangle {
}
}
}
MouseArea {
anchors.fill: parent
drag.filterChildren: true
drag.target: main
drag.axis: Drag.XAxis
drag.maximumX: 0
onReleased: {
if (main.x < -main.width/2) {
removeAnim.running = true;
} else {
openAnim.running = true;
}
}
ColumnLayout {
anchors.fill: parent
GridLayout {
@ -269,12 +267,10 @@ Rectangle {
}
}
}
Component.onCompleted: {
main.getWidgetsButton = getWidgetsButton
main.categoryButton = categoryButton
}
}
}
}