diff --git a/ui/containerbase.go b/ui/containerbase.go index d528e2d..534a4b8 100644 --- a/ui/containerbase.go +++ b/ui/containerbase.go @@ -26,6 +26,15 @@ func (c *ContainerBase) Arrange(ctx Context, bounds geom.RectangleF32, offset ge c.ControlBase.Arrange(ctx, bounds, offset, parent) } +func (c *ContainerBase) DesiredSize(ctx Context, size geom.PointF32) geom.PointF32 { + var max geom.PointF32 + for _, child := range c.Children { + s := child.DesiredSize(ctx, size) + max = geom.MaxPtF32(max, s) + } + return max +} + func (c *ContainerBase) Handle(ctx Context, e Event) bool { if c.ControlBase.Handle(ctx, e) { return true