krampus19/alui/overlay.go

40 lines
610 B
Go
Raw Normal View History

2019-12-19 05:59:45 +00:00
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(e allg5.Event) {
if o.Visible {
o.Proxy.Handle(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)
}
}