mod(element): introduce deinit interface for deinitializing Elements automatically with the Container
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m34s

This commit is contained in:
2025-11-27 21:13:03 +01:00
parent 9488d0b64d
commit 855594a8c8
7 changed files with 46 additions and 45 deletions

View File

@@ -53,7 +53,6 @@ pub fn main() !void {
var box = try App.Container.init(allocator, .{
.layout = .{ .direction = .horizontal },
}, .{});
defer box.deinit();
inline for (std.meta.fields(zterm.Color)) |field| {
if (field.value == 0) continue; // zterm.Color.default == 0 -> skip

View File

@@ -207,12 +207,9 @@ pub fn main() !void {
},
}, table_head.element()));
var box = try App.Container.init(allocator, .{
var scrollable: App.Scrollable = .init(try .init(allocator, .{
.layout = .{ .direction = .vertical },
}, text_styles.element());
defer box.deinit();
var scrollable: App.Scrollable = .init(box, .disabled);
}, text_styles.element()), .enabled(.white, true));
try container.append(try App.Container.init(allocator, .{}, scrollable.element()));
try app.start();