mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-05 09:25:38 +00:00
all: [API] replace tag parameter of Source.Event with per-filter tags
Until now, every event has had a particular target. We're about to simplify key event delivery to match the first matching filter, so there is no longer a global meaning to the tag argument to Source.Event. Add fields to filters to specify their target tags. Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
+6
-3
@@ -148,13 +148,16 @@ func (b *Clickable) Update(gtx layout.Context) (Click, bool) {
|
||||
}
|
||||
}
|
||||
filters := []event.Filter{
|
||||
key.FocusFilter{},
|
||||
key.FocusFilter{Target: b},
|
||||
}
|
||||
if b.focused {
|
||||
filters = append(filters, key.Filter{Name: key.NameReturn}, key.Filter{Name: key.NameSpace})
|
||||
filters = append(filters,
|
||||
key.Filter{Target: b, Name: key.NameReturn},
|
||||
key.Filter{Target: b, Name: key.NameSpace},
|
||||
)
|
||||
}
|
||||
for {
|
||||
e, ok := gtx.Event(b, filters...)
|
||||
e, ok := gtx.Event(filters...)
|
||||
if !ok {
|
||||
break
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user