mod: remove stack reference of unnecessary intermediate Container

This commit is contained in:
2026-01-17 22:51:50 +01:00
parent 1f93e24a37
commit 9559aa974d

View File

@@ -38,7 +38,6 @@ pub fn main() !void {
}, },
}, website.element()); }, website.element());
defer container.deinit(); defer container.deinit();
var content_container: App.Container = undefined;
// header with navigation buttons and content's title // header with navigation buttons and content's title
{ {
@@ -76,17 +75,17 @@ pub fn main() !void {
} }
try container.append(header); try container.append(header);
} }
// main actual tui_website page content // page contents
{ {
var content: Content = .{}; var content: Content = .{};
content_container = try .init(allocator, .{}, content.element()); var scrollable: App.Scrollable = .init(try .init(allocator, .{}, content.element()), .enabled(.green, false));
var scrollable: App.Scrollable = .init(content_container, .enabled(.green, false));
// intermediate container for *padding* containing the scrollable `Content` // intermediate container for *padding* containing the scrollable `Content`
var scrollable_container: App.Container = try .init(allocator, .{ var scrollable_container: App.Container = try .init(allocator, .{
.layout = .{ .padding = .horizontal(2) }, .layout = .{ .padding = .horizontal(2) },
}, .{}); }, .{});
try scrollable_container.append(try .init(allocator, .{}, scrollable.element())); try scrollable_container.append(try .init(allocator, .{}, scrollable.element()));
try container.append(scrollable_container); try container.append(scrollable_container);
} }
// footer // footer