initial refactor of Interactions.qml to add better support for touch screen gestures #114

Merged
zach merged 10 commits from feat/improved-gestures into main 2026-06-01 19:18:54 +02:00
Showing only changes of commit 6926880074 - Show all commits
+6 -31
View File
@@ -12,7 +12,6 @@ Item {
property bool dashboardShortcutActive
required property Drawing drawing
required property DrawingInput input
property bool multiGestureTriggered: false
property bool osdShortcutActive
required property Panels panels
required property BarPopouts.Wrapper popouts
@@ -55,35 +54,6 @@ Item {
anchors.fill: parent
DragHandler {
id: multiHandler
dragThreshold: 0
grabPermissions: PointerHandler.CanTakeOverFromHandlersOfDifferentType | PointerHandler.ApprovesTakeOverByAnything
maximumPointCount: 2
minimumPointCount: 2
target: null
onActiveChanged: {
if (!active)
root.multiGestureTriggered = false;
}
onCentroidChanged: {
if (root.multiGestureTriggered)
return;
const x = centroid.position.x;
const y = centroid.position.y;
const dragX = x - centroid.pressPosition.x;
const dragY = y - centroid.pressPosition.y;
if (centroid.pressPosition.x > root.screen.width - Config.barConfig.border && dragX < -20) {
root.visibilities.sidebar = true;
root.multiGestureTriggered = true;
}
}
}
DragHandler {
id: singleHandler
AramJonghu marked this conversation as resolved Outdated
Outdated
Review

Could this value also be a variable that takes a percentage of horizontal pixels on the display (or size of display eg a 14 inch display vs 24 inch).

Could this value also be a variable that takes a percentage of horizontal pixels on the display (or size of display eg a 14 inch display vs 24 inch).
Outdated
Review

Was it intentional to make this comment on line 89? Because then I don't really know what you mean, since that is deleted code.

Was it intentional to make this comment on line 89? Because then I don't really know what you mean, since that is deleted code.
Outdated
Review

Ah, yea you are right. Sunlight made it hard to see when I made the comment. Line 93 seems like the added relevant code.

I meant; how many pixels are needed in a swipe motion before it is recognized (if it is 20px)? My original comment speaks on that.

Ah, yea you are right. Sunlight made it hard to see when I made the comment. Line 93 seems like the added relevant code. I meant; how many pixels are needed in a swipe motion before it is recognized (if it is 20px)? My original comment speaks on that.
Outdated
Review

To add to this, I reread the original post. My question stands if this could be dynamic depending on display size for example.

To add to this, I reread the original post. My question stands if this could be dynamic depending on display size for example.
@@ -123,7 +93,12 @@ Item {
root.singleGestureTriggered = true;
}
if (centroid.pressPosition.x >= root.screen.width - Config.barConfig.border && dragX < -20) {
if (centroid.pressPosition.x > root.screen.width - Config.barConfig.border && centroid.pressPosition.y < (root.screen.height / 2) && dragX < -20) {
root.visibilities.sidebar = true;
root.singleGestureTriggered = true;
}
if (centroid.pressPosition.x >= root.screen.width - Config.barConfig.border && centroid.pressPosition.y > (root.screen.height / 2) && dragX < -20) {
Hypr.dispatch(`hl.dsp.focus({ workspace = 'r+1', on_current_monitor = true })`);
root.singleGestureTriggered = true;
}