final tweaks to the overview
This commit is contained in:
1 parent
ad28d4171c
commit
838924d13e
3 files changed
+45
-1
No files matched your search
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
Reference in new issue
Block a user