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
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m9s
This commit is contained in:
17
src/root.zig
17
src/root.zig
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user