Fixed two bugs with overlay visibility.

- Toggle didn't toggle but hide.
- Hide hid the overlay but didn't trigger any callbacks/events.
This commit is contained in:
Sander Schobers 2020-05-18 20:59:05 +02:00
parent 16d4e26cd0
commit 7dde894bf0

View File

@ -88,9 +88,7 @@ func (o *Overlays) Handle(ctx Context, e Event) bool {
return o.Proxy.Handle(ctx, e)
}
func (o *Overlays) Hide(name string) {
o.visible[name] = false
}
func (o *Overlays) Hide(name string) { o.SetVisibility(name, false) }
func (o *Overlays) Render(ctx Context) {
o.Proxy.Render(ctx)
@ -105,4 +103,4 @@ func (o *Overlays) SetVisibility(name string, visible bool) { o.setVisibility(na
func (o *Overlays) Show(name string) { o.SetVisibility(name, true) }
func (o *Overlays) Toggle(name string) { o.SetVisibility(name, false) }
func (o *Overlays) Toggle(name string) { o.SetVisibility(name, !o.visible[name]) }