diff options
| author | Gabriel Schneider <[email protected]> | 2026-07-05 19:42:46 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-08-01 15:02:07 -0300 |
| commit | 7988d9bc6e31210ff13994f18d5622dd57ba9341 (patch) | |
| tree | 62138868db52638cbefb18086dc226810fad761a /main.zig | |
| parent | e36e946f9a56c4ab1d10cef3aace20fe7d274dfa (diff) | |
| download | pardes-7988d9bc6e31210ff13994f18d5622dd57ba9341.tar.gz pardes-7988d9bc6e31210ff13994f18d5622dd57ba9341.zip | |
sdl: ui_sdl rework (380+ lines) + replay changes
Diffstat (limited to 'main.zig')
| -rw-r--r-- | main.zig | 21 |
1 files changed, 15 insertions, 6 deletions
@@ -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 } } }); |
