ContainerBase now provides a DesiredSize (maximum of all children, if any).
This commit is contained in:
parent
5e735440ec
commit
25e33b125b
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user