add(examples/styles): text and color styling possiblities
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s
Some checks failed
Zig Project Action / Lint, Spell-check and test zig project (push) Failing after 39s
This also contains some minor refactoring to improve the readability and understandability of the library (i.e. renaming of Style.Attributes to Style.Emphasis).
This commit is contained in:
@@ -63,8 +63,7 @@ pub fn main() !void {
|
||||
|
||||
inline for (std.meta.fields(zterm.Color)) |field| {
|
||||
if (comptime field.value == 0) continue; // zterm.Color.default == 0 -> skip
|
||||
const color = std.meta.stringToEnum(zterm.Color, field.name).?;
|
||||
try box.append(try App.Container.init(allocator, .{ .rectangle = .{ .fill = color } }, .{}));
|
||||
try box.append(try App.Container.init(allocator, .{ .rectangle = .{ .fill = @enumFromInt(field.value) } }, .{}));
|
||||
}
|
||||
var scrollable: App.Scrollable = .init(box);
|
||||
try container.append(try App.Container.init(allocator, .{}, scrollable.element()));
|
||||
|
||||
Reference in New Issue
Block a user