Removed OverlayProxy and incorporated logic into Proxy.
This commit is contained in:
parent
bcf3093c87
commit
0f54224cc7
@ -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()
|
||||
}
|
||||
}
|
15
ui/proxy.go
15
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()
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user