summaryrefslogtreecommitdiff
path: root/replay.zig
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-07-03 18:49:00 -0300
committerGabriel Schneider <[email protected]>2026-08-01 15:02:07 -0300
commita354d34329de597b80943c78e2afd84f235ee505 (patch)
tree6b161ea390a60864dd284a7b17dd8f025269567f /replay.zig
parentf3b62fe53b19e36f21f8020831718cbf095d6a7b (diff)
downloadpardes-a354d34329de597b80943c78e2afd84f235ee505.tar.gz
pardes-a354d34329de597b80943c78e2afd84f235ee505.zip
improving layout
Diffstat (limited to 'replay.zig')
-rw-r--r--replay.zig6
1 files changed, 5 insertions, 1 deletions
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;