mod: simplify Container and Element creation with updated zterm behavior
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m9s

This commit is contained in:
2025-11-27 21:23:36 +01:00
parent da9e4c89f3
commit 1485385735
3 changed files with 49 additions and 8 deletions

View File

@@ -6,15 +6,24 @@
pub const Event = union(enum) {};
pub fn Container(App: type, gpa: Allocator) !App.Container {
// TODO create container structure
// -> might require some additional arguments
return try .init(gpa, .{}, .{});
pub fn Container(App: type, gpa: Allocator, element: *elements.Root(App), tree: *elements.Tree(App), diffs: *App.Scrollable) !App.Container {
var root: App.Container = try .init(gpa, .{
.layout = .{
.direction = .horizontal,
.separator = .{
.enabled = true,
},
},
}, element.element());
try root.append(try .init(gpa, .{}, tree.element()));
try root.append(try .init(gpa, .{}, diffs.element()));
return root;
}
const std = @import("std");
const Allocator = std.mem.Allocator;
pub const elements = @import("elements.zig");
pub const Model = @import("model.zig");
test {