add(Scrollable): init function with corresponding usages
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 42s
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 42s
This commit is contained in:
@@ -78,6 +78,10 @@ pub fn Scrollable(Event: type) type {
|
||||
/// The actual `Container`, that is scrollable.
|
||||
container: Container(Event),
|
||||
|
||||
pub fn init(container: Container(Event)) @This() {
|
||||
return .{ .container = container };
|
||||
}
|
||||
|
||||
pub fn element(this: *@This()) Element(Event) {
|
||||
return .{
|
||||
.ptr = this,
|
||||
@@ -222,7 +226,7 @@ test "scrollable vertical" {
|
||||
}, .{}));
|
||||
defer box.deinit();
|
||||
|
||||
var scrollable: Scrollable(event.SystemEvent) = .{ .container = box };
|
||||
var scrollable: Scrollable(event.SystemEvent) = .init(box);
|
||||
|
||||
var container: Container(event.SystemEvent) = try .init(allocator, .{
|
||||
.border = .{
|
||||
@@ -300,7 +304,7 @@ test "scrollable horizontal" {
|
||||
}, .{}));
|
||||
defer box.deinit();
|
||||
|
||||
var scrollable: Scrollable(event.SystemEvent) = .{ .container = box };
|
||||
var scrollable: Scrollable(event.SystemEvent) = .init(box);
|
||||
|
||||
var container: Container(event.SystemEvent) = try .init(allocator, .{
|
||||
.border = .{
|
||||
|
||||
Reference in New Issue
Block a user