diff --git a/ui/overlayproxy.go b/ui/overlayproxy.go deleted file mode 100644 index 22826f2..0000000 --- a/ui/overlayproxy.go +++ /dev/null @@ -1,19 +0,0 @@ -package ui - -type OverlayProxy struct { - Proxy -} - -func (p *OverlayProxy) Shown() { - overlay, ok := p.Content.(Overlay) - if ok { - overlay.Shown() - } -} - -func (p *OverlayProxy) Hidden() { - overlay, ok := p.Content.(Overlay) - if ok { - overlay.Hidden() - } -} diff --git a/ui/proxy.go b/ui/proxy.go index d4a6273..c82e493 100644 --- a/ui/proxy.go +++ b/ui/proxy.go @@ -3,6 +3,7 @@ package ui import "opslag.de/schobers/geom" var _ Control = &Proxy{} +var _ Overlay = &Proxy{} type Proxy struct { Content Control @@ -32,6 +33,13 @@ func (p *Proxy) Disable() { p.Content.Disable() } func (p *Proxy) Enable() { p.Content.Enable() } +func (p *Proxy) Hidden() { + overlay, ok := p.Content.(Overlay) + if ok { + overlay.Hidden() + } +} + func (p *Proxy) IsDisabled() bool { return p.Content.IsDisabled() } func (p *Proxy) IsInBounds(pt geom.PointF32) bool { return p.Content.IsInBounds(pt) } @@ -41,3 +49,10 @@ func (p *Proxy) IsOver() bool { return p.Content.IsOver() } func (p *Proxy) Offset() geom.PointF32 { return p.Content.Offset() } func (p *Proxy) Parent() Control { return p.Content.Parent() } + +func (p *Proxy) Shown() { + overlay, ok := p.Content.(Overlay) + if ok { + overlay.Shown() + } +}