From a354d34329de597b80943c78e2afd84f235ee505 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 3 Jul 2026 18:49:00 -0300 Subject: improving layout --- replay.zig | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'replay.zig') diff --git a/replay.zig b/replay.zig index e08a461c..19b894fe 100644 --- a/replay.zig +++ b/replay.zig @@ -165,6 +165,10 @@ fn paneVWeight(panes: []const Pane, id: usize) ?f32 { return panes[id].vweight; } +fn setPaneVWeight(panes: []Pane, id: usize, weight: f32) void { + panes[id].vweight = weight; +} + fn renderPane(alloc: std.mem.Allocator, root: ui.Window, p: *Pane, r: Rect, active: bool) !void { if (r.w <= GUTTER or r.h == 0) return; const text = root.child(.{ .x_off = r.x + GUTTER, .y_off = r.y, .width = r.w - GUTTER, .height = r.h }); @@ -629,7 +633,7 @@ const App = struct { self.panes[b].vweight = pair - self.panes[a].vweight; } }, - .move => |d| moveTerm(&self.layout, &self.rects, &self.col_x, &self.col_w, d.id, d.cur_x, d.cur_y), + .move => |d| moveTerm(&self.layout, self.panes, &self.rects, &self.col_x, &self.col_w, d.id, d.cur_x, d.cur_y, setPaneVWeight), .none => {}, } self.drag = .none; -- cgit v1.3