libvaxis icon indicating copy to clipboard operation
libvaxis copied to clipboard

FlexRow in ListView

Open rrveex opened this issue 8 months ago • 1 comments

Having a ListView of FlexRows doesn't work, because FlexRow.draw() asserts ctx.max.height != null.

This works, but I don't know if it's correct:

diff --git a/src/vxfw/ListView.zig b/src/vxfw/ListView.zig
index 309ebe8..2513cc9 100644
--- a/src/vxfw/ListView.zig
+++ b/src/vxfw/ListView.zig
@@ -233,7 +233,7 @@ fn insertChildren(
         // Set up constraints. We let the child be the entire height if it wants
         const child_ctx = ctx.withConstraints(
             .{ .width = max_size.width - child_offset, .height = 0 },
-            .{ .width = max_size.width - child_offset, .height = null },
+            .{ .width = max_size.width - child_offset, .height = max_size.height },
         );
 
         // Draw the child

rrveex avatar Aug 16 '25 14:08 rrveex

Same thing is with border and flexcolumn. I feel like the Flex* should be looked at. Theres a lot of asserts for null width/height in the widgets and Flex* tries to draw a lot of the widgets with a null width/height.

sudokit avatar Nov 24 '25 15:11 sudokit