mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
fix the swipe out gesture
This commit is contained in:
parent
d3b41afc02
commit
2a0152bad0
1 changed files with 84 additions and 88 deletions
|
|
@ -38,7 +38,16 @@ Rectangle {
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
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 {
|
NumberAnimation {
|
||||||
|
|
@ -98,6 +107,7 @@ Rectangle {
|
||||||
onShouldClose: removeAnim.running = true;
|
onShouldClose: removeAnim.running = true;
|
||||||
}
|
}
|
||||||
MobileComponents.SplitDrawer {
|
MobileComponents.SplitDrawer {
|
||||||
|
id: splitDrawer
|
||||||
visible: true
|
visible: true
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
drawer: PlasmaExtras.ScrollArea {
|
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 {
|
ColumnLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
|
@ -269,12 +267,10 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
Component.onCompleted: {
|
Component.onCompleted: {
|
||||||
main.getWidgetsButton = getWidgetsButton
|
main.getWidgetsButton = getWidgetsButton
|
||||||
main.categoryButton = categoryButton
|
main.categoryButton = categoryButton
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue