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:
@@ -148,10 +148,10 @@ pub fn main() !void {
|
||||
defer container.deinit();
|
||||
|
||||
// place empty container containing the element of the scrollable Container.
|
||||
var scrollable_top: App.Scrollable = .init(top_box);
|
||||
var scrollable_top: App.Scrollable = .init(top_box, .enabled(.grey));
|
||||
try container.append(try App.Container.init(allocator, .{}, scrollable_top.element()));
|
||||
|
||||
var scrollable_bottom: App.Scrollable = .init(bottom_box);
|
||||
var scrollable_bottom: App.Scrollable = .init(bottom_box, .enabled(.white));
|
||||
try container.append(try App.Container.init(allocator, .{}, scrollable_bottom.element()));
|
||||
|
||||
try app.start();
|
||||
@@ -182,7 +182,7 @@ pub fn main() !void {
|
||||
else => {},
|
||||
}
|
||||
|
||||
container.resize(try renderer.resize());
|
||||
container.resize(try renderer.resize());
|
||||
container.reposition(.{});
|
||||
try renderer.render(@TypeOf(container), &container);
|
||||
try renderer.flush();
|
||||
|
||||
Reference in New Issue
Block a user