From 838924d13e66d8d2b0d676b21aed0223cc042fe5 Mon Sep 17 00:00:00 2001 From: Ari Sosnovsky Date: Tue, 1 Sep 2026 16:57:58 -0400 Subject: [PATCH] final tweaks to the overview --- configs/fwbook/quickshell/ABOUTME.md | 4 +- .../quickshell/overview/OverviewWindow.qml | 38 +++++++++++++++++++ configs/fwbook/quickshell/overview/Theme.qml | 4 ++ 3 files changed, 45 insertions(+), 1 deletion(-) diff --git a/configs/fwbook/quickshell/ABOUTME.md b/configs/fwbook/quickshell/ABOUTME.md index 080acc2..a0882c1 100644 --- a/configs/fwbook/quickshell/ABOUTME.md +++ b/configs/fwbook/quickshell/ABOUTME.md @@ -19,7 +19,9 @@ plugin (Hyprland has none maintained against tagged releases — see horizontal strip of that workspace's windows (columns), sorted by x-position to match the Hyprland `scrolling` layout's tape order. - **Controls:** Arrow keys move the selection (Left/Right = window in the row, - Up/Down = workspace row), Enter focuses the selection and closes, Esc + Up/Down = workspace row), a two-finger trackpad swipe does the same + (vertical = workspace row, horizontal = window in the row), Enter focuses + the selection and closes, Esc cancels, `M` cycles to the next monitor's overview, number keys 1-9 jump straight to the Nth monitor (sorted by Hyprland's monitor id) — also clickable via the monitor bar at the top of the screen. Hovering a window diff --git a/configs/fwbook/quickshell/overview/OverviewWindow.qml b/configs/fwbook/quickshell/overview/OverviewWindow.qml index 45da7e9..3a31777 100644 --- a/configs/fwbook/quickshell/overview/OverviewWindow.qml +++ b/configs/fwbook/quickshell/overview/OverviewWindow.qml @@ -235,6 +235,44 @@ PanelWindow { event.accepted = true; } + // Two-finger trackpad swipe moves the selection like the arrow keys: + // vertical swipe = workspace rows, horizontal swipe = windows in a + // row. High-res trackpads report swipes as pixel deltas (angleDelta is + // tiny/zero), so prefer pixelDelta and fall back to angleDelta (for + // notch-style mice). Deltas accumulate on the dominant axis and a + // single step is taken once the swipe crosses the threshold. + WheelHandler { + id: swipeHandler + target: focusScope + property real accY: 0 + property real accX: 0 + + function step(dRow, dCol) { + root.moveSelection(dRow, dCol); + swipeHandler.accY = 0; + swipeHandler.accX = 0; + } + + onWheel: event => { + console.log("WHEEL px=" + event.pixelDelta.x + "," + event.pixelDelta.y + + " ang=" + event.angleDelta.x + "," + event.angleDelta.y); + const px = event.pixelDelta; + const ang = event.angleDelta; + const dx = px.x !== 0 ? px.x : ang.x; + const dy = px.y !== 0 ? px.y : ang.y; + swipeHandler.accX += dx; + swipeHandler.accY += dy; + + if (Math.abs(swipeHandler.accY) >= Math.abs(swipeHandler.accX)) { + if (swipeHandler.accY <= -root.theme.swipeThreshold) swipeHandler.step(-1, 0); + else if (swipeHandler.accY >= root.theme.swipeThreshold) swipeHandler.step(1, 0); + } else { + if (swipeHandler.accX <= -root.theme.swipeThreshold) swipeHandler.step(0, 1); + else if (swipeHandler.accX >= root.theme.swipeThreshold) swipeHandler.step(0, -1); + } + } + } + MonitorBar { anchors.top: parent.top anchors.topMargin: 24 diff --git a/configs/fwbook/quickshell/overview/Theme.qml b/configs/fwbook/quickshell/overview/Theme.qml index 51017bc..81cd510 100644 --- a/configs/fwbook/quickshell/overview/Theme.qml +++ b/configs/fwbook/quickshell/overview/Theme.qml @@ -21,4 +21,8 @@ QtObject { readonly property real carouselScaleStep: 0.08 readonly property real carouselMaxScaleReduction: 0.3 readonly property int carouselDuration: 220 + + // A two-finger swipe must cross this many pixels (or angleDelta units) + // before the selection steps once. + readonly property int swipeThreshold: 120 }