Add custom layout creation.

This commit is contained in:
Greyson Parrelli
2026-08-11 13:57:54 -04:00
parent a7a9429d09
commit 3026bdcd4c
14 changed files with 1964 additions and 20 deletions
+16
View File
@@ -157,6 +157,22 @@ pub fn remove(self: *Layout, node: *Node) void {
self.alloc.destroy(parent);
}
/// Build a split holding two existing subtrees.
///
/// `insert` grows a tree one pane at a time, which is the right shape for
/// interactive splitting but can't express an arbitrary arrangement with
/// per-split ratios. Opening a saved layout needs exactly that, so it builds
/// the tree bottom-up through this instead.
pub fn newSplit(
self: *Layout,
orientation: gtk.Orientation,
a: *Node,
b: *Node,
ratio: f64,
) !*Node {
return self.makeSplit(orientation, a, b, ratio);
}
fn makeSplit(
self: *Layout,
orientation: gtk.Orientation,