mod: use allocators for Layout and Widget types
This commit is contained in:
@@ -30,10 +30,10 @@ 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.Padding.init(allocator, .{
|
||||
var layout = Layout.createFrom(allocator, Layout.Padding.init(allocator, .{
|
||||
.padding = 15,
|
||||
}, .{
|
||||
.layout = Layout.createFrom(Layout.Framing.init(allocator, .{
|
||||
.layout = Layout.createFrom(allocator, Layout.Framing.init(allocator, .{
|
||||
.style = .{
|
||||
.fg = .{
|
||||
.index = 6,
|
||||
@@ -49,13 +49,13 @@ pub fn main() !void {
|
||||
},
|
||||
},
|
||||
}, .{
|
||||
.layout = Layout.createFrom(Layout.Margin.init(
|
||||
.layout = Layout.createFrom(allocator, Layout.Margin.init(
|
||||
allocator,
|
||||
.{
|
||||
.margin = 10,
|
||||
},
|
||||
.{
|
||||
.widget = Widget.createFrom(blk: {
|
||||
.widget = Widget.createFrom(allocator, blk: {
|
||||
const file = try std.fs.cwd().openFile("./examples/padding.zig", .{});
|
||||
defer file.close();
|
||||
const widget = Widget.RawText.init(allocator, file);
|
||||
|
||||
Reference in New Issue
Block a user