allg5/alui/overlay.go

40 lines
629 B
Go

package alui
import (
"opslag.de/schobers/allg5"
"opslag.de/schobers/geom"
)
type Overlay struct {
ControlBase
Proxy Control
Visible bool
}
func (o *Overlay) DesiredSize(ctx *Context) geom.PointF32 {
if o.Visible {
return o.Proxy.DesiredSize(ctx)
}
return geom.ZeroPtF32
}
func (o *Overlay) Handle(ctx *Context, e allg5.Event) {
if o.Visible {
o.Proxy.Handle(ctx, e)
}
}
func (o *Overlay) Render(ctx *Context, bounds geom.RectangleF32) {
if o.Visible {
o.Proxy.Render(ctx, bounds)
}
}
func (o *Overlay) Layout(ctx *Context, bounds geom.RectangleF32) {
if o.Visible {
o.Proxy.Layout(ctx, bounds)
}
}