From 7dde894bf0f5b13da68e4185334525c97c4dc18a Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Mon, 18 May 2020 20:59:05 +0200 Subject: [PATCH] Fixed two bugs with overlay visibility. - Toggle didn't toggle but hide. - Hide hid the overlay but didn't trigger any callbacks/events. --- ui/overlays.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/ui/overlays.go b/ui/overlays.go index 3fd96ad..40ae4cc 100644 --- a/ui/overlays.go +++ b/ui/overlays.go @@ -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]) }