Overlays all handle the same events but if a overlay handles the event then the content won't get the event.

This commit is contained in:
Sander Schobers 2020-05-17 16:11:47 +02:00
parent 0c399a8d93
commit bcf3093c87

View File

@ -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 { func (o *Overlays) Handle(ctx Context, e Event) bool {
var handled bool
for overlay, visible := range o.visible { for overlay, visible := range o.visible {
if 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) return o.Proxy.Handle(ctx, e)
} }