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
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 1m34s
This commit is contained in:
@@ -66,7 +66,6 @@ pub fn main() !void {
|
||||
try box.append(try App.Container.init(allocator, .{
|
||||
.rectangle = .{ .fill = .lightgreen },
|
||||
}, .{}));
|
||||
defer box.deinit();
|
||||
|
||||
var scrollable: App.Scrollable = .init(box, .disabled);
|
||||
|
||||
|
||||
@@ -73,8 +73,6 @@ pub fn main() !void {
|
||||
defer renderer.deinit();
|
||||
|
||||
var input_field: App.Input(.accept) = .init(allocator, &app.queue, .init(.black, .blue));
|
||||
defer input_field.deinit();
|
||||
|
||||
var mouse_draw: MouseDraw = .{};
|
||||
var second_mouse_draw: MouseDraw = .{};
|
||||
var quit_text: QuitText = .{};
|
||||
|
||||
@@ -106,7 +106,6 @@ pub fn main() !void {
|
||||
.dim = .{ .y = 2 },
|
||||
},
|
||||
}, .{}));
|
||||
defer top_box.deinit();
|
||||
|
||||
var bottom_box = try App.Container.init(allocator, .{
|
||||
.border = .{
|
||||
@@ -134,7 +133,6 @@ pub fn main() !void {
|
||||
try bottom_box.append(try App.Container.init(allocator, .{
|
||||
.rectangle = .{ .fill = .grey },
|
||||
}, .{}));
|
||||
defer bottom_box.deinit();
|
||||
|
||||
var container = try App.Container.init(allocator, .{
|
||||
.layout = .{
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user