summaryrefslogtreecommitdiff
path: root/main.zig
diff options
context:
space:
mode:
Diffstat (limited to 'main.zig')
-rw-r--r--main.zig21
1 files changed, 15 insertions, 6 deletions
diff --git a/main.zig b/main.zig
index b96ea3a5..f787f7f5 100644
--- a/main.zig
+++ b/main.zig
@@ -151,6 +151,7 @@ pub const Command = struct {
mouse: vaxis.Mouse,
paste: []const u8, // OSC 52 system-clipboard read reply (the loop decodes it)
pinch: f32,
+ touch_scroll_delta: f32,
} = .nop;
};
@@ -311,6 +312,7 @@ var colors_on: bool = true;
// central command dispatcher can flip it; the render reads it.
var show_debug: bool = false;
var ov_pinch_scale: f32 = 1.0;
+var ov_touch_scroll_delta: f32 = 0.0;
// Builtins. Executing the name (middle-click / Tab) runs the action through the ONE
// dispatcher (onSelect + actOnSelection), no matter where the name is shown — a pane
@@ -3393,6 +3395,9 @@ pub fn main(init: std.process.Init) !void {
.pinch => |scale| {
ov_pinch_scale = scale;
},
+ .touch_scroll_delta => |delta| {
+ ov_touch_scroll_delta = delta;
+ },
.quit => break,
else => {},
}
@@ -3431,6 +3436,10 @@ pub fn main(init: std.process.Init) !void {
.mouse => |next_mouse| {
handled = handleWheelMouse(&terms, &rects, screen_w, screen_h, &hover_col, &hover_row, next_mouse);
},
+ .touch_scroll_delta => |delta| {
+ ov_touch_scroll_delta = delta;
+ handled = true;
+ },
else => {},
}
if (!handled) {
@@ -3577,12 +3586,12 @@ pub fn main(init: std.process.Init) !void {
sb_total = sb.total;
}
const s = std.fmt.bufPrint(
- &ov_buf,
- "pardes resizes={d}\nterms {d} cols {d}\nactive #{d} {d}x{d}\nscroll {d}/{d}\npinch {d:6.4}",
- .{ resize_count, nlive, layout.ncol, active, at.cols, at.rows, sb_off, sb_total, ov_pinch_scale },
- ) catch "";
- const ow: u16 = 30;
- const oh: u16 = 7;
+ &ov_buf,
+ "pardes resizes={d}\nterms {d} cols {d}\nactive #{d} {d}x{d}\nscroll {d}/{d}\npinch {d:6.4}\ntscroll {d:7.4}",
+ .{ resize_count, nlive, layout.ncol, active, at.cols, at.rows, sb_off, sb_total, ov_pinch_scale, ov_touch_scroll_delta },
+ ) catch "";
+ const ow: u16 = 30;
+ const oh: u16 = 8;
const ox: u16 = if (screen_w > ow) screen_w - ow else 0;
const ov = win.child(.{ .x_off = ox, .y_off = TOPBAR_H, .width = ow, .height = oh, .border = .{ .where = .all } });
ov.fill(.{ .char = .{ .grapheme = " " }, .style = .{ .bg = .{ .rgb = gray.bar } } });