mirror of
https://github.com/vsariola/sointu.git
synced 2025-11-12 12:52:53 -05:00
feat(tracker): add a preset explorer with search and filters
Closes #91
This commit is contained in:
parent
3f365707c2
commit
2336a135c6
@ -8,6 +8,9 @@ import (
|
||||
)
|
||||
|
||||
type TagYieldFunc func(level int, tag event.Tag) bool
|
||||
type Tagged interface {
|
||||
Tags(level int, yield TagYieldFunc) bool
|
||||
}
|
||||
|
||||
// FocusNext navigates to the next focusable tag in the tracker. If stepInto is
|
||||
// true, it will focus the next tag regardless of its depth; otherwise it will
|
||||
@ -77,3 +80,12 @@ func (t *Tracker) findFocusedLevel(gtx C) (level int, ok bool) {
|
||||
})
|
||||
return level, ok
|
||||
}
|
||||
|
||||
func firstTag(t Tagged) (tag event.Tag, ok bool) {
|
||||
t.Tags(0, func(level int, t event.Tag) bool {
|
||||
tag = t
|
||||
ok = true
|
||||
return false
|
||||
})
|
||||
return tag, ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user