ContainerBase now provides a DesiredSize (maximum of all children, if any).
This commit is contained in:
parent
cc32cf5bc3
commit
b0a13d1a3c
@ -26,6 +26,15 @@ func (c *ContainerBase) Arrange(ctx Context, bounds geom.RectangleF32, offset ge
|
|||||||
c.ControlBase.Arrange(ctx, bounds, offset, parent)
|
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 {
|
func (c *ContainerBase) Handle(ctx Context, e Event) bool {
|
||||||
if c.ControlBase.Handle(ctx, e) {
|
if c.ControlBase.Handle(ctx, e) {
|
||||||
return true
|
return true
|
||||||
|
Loading…
Reference in New Issue
Block a user