feat(element/scrollable): scrollbar rendering
Configuration to enable scrollbar rendering for scrollable `Element`s. Currently only the fg `Color` of the scrollbar can be configured while the background uses the same fg `Color` but adds the emphasis `.dim` to make it obvious what the is the actual scrollbar. In the future it might be necessary to provide the user with more options to configure the representation of the scrollbar. Tests have been added to test the scrollbar rendering and placement accordingly.
This commit is contained in:
@@ -56,7 +56,7 @@ pub fn main() !void {
|
||||
if (comptime field.value == 0) continue; // zterm.Color.default == 0 -> skip
|
||||
try box.append(try App.Container.init(allocator, .{ .rectangle = .{ .fill = @enumFromInt(field.value) } }, .{}));
|
||||
}
|
||||
var scrollable: App.Scrollable = .init(box);
|
||||
var scrollable: App.Scrollable = .init(box, .disabled);
|
||||
try container.append(try App.Container.init(allocator, .{}, scrollable.element()));
|
||||
|
||||
try app.start();
|
||||
|
||||
Reference in New Issue
Block a user