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 "../components"
|
||||
|
||||
MouseArea {
|
||||
MouseEventListener {
|
||||
id: root
|
||||
width: 1080
|
||||
height: 1920
|
||||
|
|
@ -40,8 +40,6 @@ MouseArea {
|
|||
property int buttonHeight: width/4
|
||||
property bool containmentsEnterFromRight: true
|
||||
|
||||
drag.filterChildren: true
|
||||
|
||||
//NOTE: this
|
||||
PathView {
|
||||
id: activitiesRepresentation
|
||||
|
|
@ -62,8 +60,15 @@ MouseArea {
|
|||
}
|
||||
}
|
||||
property int mouseDownX
|
||||
onPressed: mouseDownX = mouse.x
|
||||
property int mouseDownY
|
||||
onPressed: {
|
||||
mouseDownX = mouse.x
|
||||
mouseDownY = mouse.y
|
||||
}
|
||||
onReleased: {
|
||||
if (Math.abs(mouse.x - mouseDownX) < Math.abs(mouse.y - mouseDownY)) {
|
||||
return;
|
||||
}
|
||||
if (mouse.x - mouseDownX > root.width/6) {
|
||||
root.containmentsEnterFromRight = false;
|
||||
activitiesRepresentation.decrementCurrentIndex();
|
||||
|
|
|
|||
Loading…
Reference in a new issue