Closed divinae closed 4 years ago
Forget about the "redo the pull request" part. I don't think it's necessary. It's my first project with the pull request workflow.
Your changes look good. It's still doesn't work perfect with touchpad - I will try to find some better solution, but you can merge this in current state :)
With tcorreabr changes scrolling is reversed
I'm not sure why, but:
PlasmaCore.DataSource {
id: executable
engine: "executable"
connectedSources: []
onNewData: disconnectSource(sourceName)
function exec(cmd) {
connectSource(cmd)
}
}
WheelHandler {
property int wheelDelta: 0
onWheel: {
wheelDelta += event.angleDelta.y;
if (wheelDelta >= 120 || wheelDelta <= -120) {
wheelDelta > 0 ? executable.exec("qdbus org.kde.KWin /KWin previousDesktop") : executable.exec("qdbus org.kde.KWin /KWin nextDesktop");
wheelDelta = 0;
}
}
}
works better. It is eliminates some accident multiple desktop changes.
I came up with another solution again. It also avoids multiple desktop changes and doesn't need PlasmaCore.DataSource. Could you please review it?
WheelHandler {
property int wheelDelta: 0
onWheel: wheelDelta += event.angleDelta.y;
onActiveChanged: {
if (active === true) return;
if (wheelDelta >= 120 || wheelDelta <= -120) {
wheelDelta > 0 ? workspace.currentDesktop-- : workspace.currentDesktop++;
wheelDelta = 0;
}
}
}
I like this - should I update this Pull Request with your code, or you commit is yourself?
I just noticed that regardles of this new changes, touchpad horizontal scroll to the left changes screen, but scroll on the right does nothing. @divinae can you check if you experience this behavior?
I just noticed that regardles of this new changes, touchpad horizontal scroll to the left changes screen, but scroll on the right does nothing. @divinae can you check if you experience this behavior?
It's should work only for vertical scroll
I like this - should I update this Pull Request with your code, or you commit is yourself?
I made the new commit. I think now we are ready for the pull request merge.
I just noticed that regardles of this new changes, touchpad horizontal scroll to the left changes screen, but scroll on the right does nothing. @divinae can you check if you experience this behavior?
I don't use horizontal scroll on my touchpad, so I couldn't reproduce what you described. If so, maybe we can resolve this later through a new issue.
To improve screen change using touchpad scroll. It's algorithm taken from SimpleMenu (https://github.com/KDE/plasma-simplemenu)