mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
use a mouseeventlistener for activity switch
use a mouseeventlistener to trigger the switch more easily
This commit is contained in:
parent
f4d50e0743
commit
94dfff925c
1 changed files with 9 additions and 4 deletions
|
|
@ -28,7 +28,7 @@ import org.kde.kquickcontrolsaddons 2.0
|
||||||
import org.kde.activities 0.1 as Activities
|
import org.kde.activities 0.1 as Activities
|
||||||
import "../components"
|
import "../components"
|
||||||
|
|
||||||
MouseArea {
|
MouseEventListener {
|
||||||
id: root
|
id: root
|
||||||
width: 1080
|
width: 1080
|
||||||
height: 1920
|
height: 1920
|
||||||
|
|
@ -40,8 +40,6 @@ MouseArea {
|
||||||
property int buttonHeight: width/4
|
property int buttonHeight: width/4
|
||||||
property bool containmentsEnterFromRight: true
|
property bool containmentsEnterFromRight: true
|
||||||
|
|
||||||
drag.filterChildren: true
|
|
||||||
|
|
||||||
//NOTE: this
|
//NOTE: this
|
||||||
PathView {
|
PathView {
|
||||||
id: activitiesRepresentation
|
id: activitiesRepresentation
|
||||||
|
|
@ -62,8 +60,15 @@ MouseArea {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
property int mouseDownX
|
property int mouseDownX
|
||||||
onPressed: mouseDownX = mouse.x
|
property int mouseDownY
|
||||||
|
onPressed: {
|
||||||
|
mouseDownX = mouse.x
|
||||||
|
mouseDownY = mouse.y
|
||||||
|
}
|
||||||
onReleased: {
|
onReleased: {
|
||||||
|
if (Math.abs(mouse.x - mouseDownX) < Math.abs(mouse.y - mouseDownY)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (mouse.x - mouseDownX > root.width/6) {
|
if (mouse.x - mouseDownX > root.width/6) {
|
||||||
root.containmentsEnterFromRight = false;
|
root.containmentsEnterFromRight = false;
|
||||||
activitiesRepresentation.decrementCurrentIndex();
|
activitiesRepresentation.decrementCurrentIndex();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue