feat: focus search editor after "add unit"

This commit is contained in:
qm210
2024-10-27 08:08:12 +01:00
committed by Veikko Sariola
parent 8d7d896375
commit 639b2266e3
3 changed files with 23 additions and 5 deletions

View File

@ -13,8 +13,9 @@ type (
// application while editing (particularly: to prevent triggering notes
// while editing).
Editor struct {
Editor widget.Editor
filters []event.Filter
Editor widget.Editor
filters []event.Filter
requestFocus bool
}
EditorStyle material.EditorStyle
@ -76,6 +77,10 @@ func (e *Editor) Cancelled(gtx C) bool {
return false
}
func (e *Editor) Focus() {
e.requestFocus = true
}
func (e *EditorStyle) Layout(gtx C) D {
return material.EditorStyle(*e).Layout(gtx)
}