From bcf3093c874542b6937eff591e6043932ac760c6 Mon Sep 17 00:00:00 2001 From: Sander Schobers Date: Sun, 17 May 2020 16:11:47 +0200 Subject: [PATCH] Overlays all handle the same events but if a overlay handles the event then the content won't get the event. --- ui/overlays.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ui/overlays.go b/ui/overlays.go index e8edaaf..3fd96ad 100644 --- a/ui/overlays.go +++ b/ui/overlays.go @@ -74,11 +74,17 @@ func (o *Overlays) Arrange(ctx Context, bounds geom.RectangleF32, offset geom.Po } func (o *Overlays) Handle(ctx Context, e Event) bool { + var handled bool for overlay, visible := range o.visible { if visible { - o.overlays[overlay].Handle(ctx, e) // ignore handled state on overlays + if o.overlays[overlay].Handle(ctx, e) { // handle all overlays regardless of return value + handled = true + } } } + if handled { + return true + } return o.Proxy.Handle(ctx, e) }