mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
gestures: Trigger task switcher when mouse pulls up on gesture bar
As a stopgap until we have https://invent.kde.org/plasma/plasma-mobile/-/issues/492, simply trigger the task switcher when a mouse pulls up on the gesture bar.
This commit is contained in:
parent
afa2f06b47
commit
832597f926
1 changed files with 13 additions and 0 deletions
|
|
@ -35,6 +35,19 @@ Rectangle {
|
||||||
onClicked: root.handleClicked()
|
onClicked: root.handleClicked()
|
||||||
onPressAndHold: root.handlePressedAndHeld()
|
onPressAndHold: root.handlePressedAndHeld()
|
||||||
|
|
||||||
|
property real startX
|
||||||
|
property real startY
|
||||||
|
onPressed: {
|
||||||
|
startX = mouseX;
|
||||||
|
startY = mouseY;
|
||||||
|
}
|
||||||
|
onPositionChanged: (mouse) => {
|
||||||
|
// Trigger gesture after threshold is crossed (root.height)
|
||||||
|
if (startY - mouse.y > root.height) {
|
||||||
|
root.handleClicked();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue