Commit 94dfff92 authored by Marco Martin's avatar Marco Martin

use a mouseeventlistener for activity switch

use a mouseeventlistener to trigger the switch more easily
parent f4d50e07
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment