refactor(tracker/gioui): give Editor Text / SetText methods

This commit is contained in:
5684185+vsariola@users.noreply.github.com
2024-10-14 23:36:32 +03:00
parent 03c994e4da
commit 2b7ce39069
3 changed files with 40 additions and 40 deletions

View File

@ -39,6 +39,16 @@ func MaterialEditor(th *material.Theme, e *Editor, hint string) EditorStyle {
return EditorStyle(material.Editor(th, &e.Editor, hint))
}
func (e *Editor) SetText(s string) {
if e.Editor.Text() != s {
e.Editor.SetText(s)
}
}
func (e *Editor) Text() string {
return e.Editor.Text()
}
func (e *Editor) Submitted(gtx C) bool {
for {
ev, ok := e.Editor.Update(gtx)