mod(main): adapt example to showcase configuration of Layout.Padding and Layout.Framing
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 37s

This commit is contained in:
2024-11-11 12:30:56 +01:00
parent 430f2866e8
commit 1544a4d2ff

View File

@@ -37,10 +37,33 @@ pub fn main() !void {
break :blk &spacer;
}),
Layout.createFrom(framing: {
var framing = Layout.Framing.init(allocator, .{
var framing = Layout.Framing.init(
allocator,
.{
.style = .{
.fg = .{
.index = 6,
},
},
.frame = .round,
.title = .{
.str = "VStack",
.style = .{
.ul_style = .single,
.ul = .{ .index = 6 },
.bold = true,
},
},
},
.{
.layout = Layout.createFrom(
padding: {
var padding = Layout.Padding.init(allocator, 2, .{
var padding = Layout.Padding.init(
allocator,
.{
.padding = 1,
},
.{
.layout = Layout.createFrom(vstack: {
var vstack = Layout.VStack.init(allocator, .{
Widget.createFrom(blk: {
@@ -62,11 +85,13 @@ pub fn main() !void {
});
break :vstack &vstack;
}),
});
},
);
break :padding &padding;
},
),
});
},
);
break :framing &framing;
}),
Widget.createFrom(blk: {