Add custom layout creation.
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user