mod: use allocators for Layout and Widget types
This commit is contained in:
@@ -30,19 +30,19 @@ pub fn main() !void {
|
||||
// TODO: when not running fullscreen, the application needs to screen down accordingly to display the contents
|
||||
// -> size hint how much should it use?
|
||||
|
||||
var layout = Layout.createFrom(Layout.HContainer.init(allocator, .{
|
||||
var layout = Layout.createFrom(allocator, Layout.HContainer.init(allocator, .{
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
15,
|
||||
},
|
||||
.{
|
||||
Layout.createFrom(Layout.VContainer.init(allocator, .{
|
||||
Layout.createFrom(allocator, Layout.VContainer.init(allocator, .{
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
25,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(blk: {
|
||||
Widget.createFrom(allocator, blk: {
|
||||
const file = try std.fs.cwd().openFile("./src/app.zig", .{});
|
||||
defer file.close();
|
||||
const widget = Widget.RawText.init(allocator, file);
|
||||
@@ -51,14 +51,14 @@ pub fn main() !void {
|
||||
50,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
25,
|
||||
},
|
||||
})),
|
||||
70,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
15,
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user