add(sizing): grow configuration
All checks were successful
Zig Project Action / Lint, Spell-check and test zig project (push) Successful in 1m14s

Currently the 'grid' and 'mixed' examples are not working yet.
This commit is contained in:
2025-03-05 22:53:28 +01:00
parent 9ec335cad8
commit e3551fa624
6 changed files with 121 additions and 52 deletions

View File

@@ -94,8 +94,8 @@ pub fn Scrollable(Event: type) type {
this.size = size;
// TODO scrollbar space - depending on configuration and only if necessary?
this.container_size = Point.max(size, this.container.fit_resize());
this.container.resize(.{}, this.container_size);
this.container.resize(.{}, this.size);
this.container_size = this.container.size;
}
fn handle(ctx: *anyopaque, event: Event) !void {
@@ -206,7 +206,9 @@ test "scrollable vertical" {
.direction = .vertical,
.padding = .all(1),
},
.size = .{ .y = size.y + 15 },
.size = .{
.dim = .{ .y = size.y + 15 },
},
}, .{});
try box.append(try .init(allocator, .{
.rectangle = .{ .fill = .grey },
@@ -281,7 +283,9 @@ test "scrollable horizontal" {
.direction = .horizontal,
.padding = .all(1),
},
.size = .{ .x = size.x + 15 },
.size = .{
.dim = .{ .x = size.x + 15 },
},
}, .{});
try box.append(try .init(allocator, .{
.rectangle = .{ .fill = .grey },