mod: use allocators for Layout and Widget types
This commit is contained in:
@@ -31,14 +31,14 @@ 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.VContainer.init(allocator, .{
|
||||
var layout = Layout.createFrom(allocator, Layout.VContainer.init(allocator, .{
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
45,
|
||||
},
|
||||
.{
|
||||
Layout.createFrom(Layout.Framing.init(allocator, .{}, .{
|
||||
.widget = Widget.createFrom(Widget.Text.init(allocator, .center, &[_]Cell{
|
||||
Layout.createFrom(allocator, Layout.Framing.init(allocator, .{}, .{
|
||||
.widget = Widget.createFrom(allocator, Widget.Text.init(allocator, .center, &[_]Cell{
|
||||
.{ .content = "Press " },
|
||||
.{ .content = "Ctrl+n", .style = .{ .fg = .{ .index = 6 } } },
|
||||
.{ .content = " to launch $EDITOR" },
|
||||
@@ -47,7 +47,7 @@ pub fn main() !void {
|
||||
10,
|
||||
},
|
||||
.{
|
||||
Widget.createFrom(Widget.Spacer.init(allocator)),
|
||||
Widget.createFrom(allocator, Widget.Spacer.init(allocator)),
|
||||
45,
|
||||
},
|
||||
}));
|
||||
|
||||
Reference in New Issue
Block a user