Skip to content

Commit

Permalink
Actually look up all types to get the info!
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 2, 2024
1 parent 5c159dd commit 63bbe73
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions pkg/gui/edit.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ func CreateNew(name string) fyne.CanvasObject {
if match, ok := guidefs.Widgets[name]; ok {
return match.Create()
}
if match, ok := guidefs.Collections[name]; ok {
return match.Create()
}
if match, ok := guidefs.Containers[name]; ok {
return match.Create()
}

return nil
}
Expand All @@ -26,6 +32,12 @@ func EditorFor(o fyne.CanvasObject, props map[string]string) []*widget.FormItem
if match, ok := guidefs.Widgets[clazz]; ok {
return match.Edit(o, props)
}
if match, ok := guidefs.Collections[clazz]; ok {
return match.Edit(o, props)
}
if match, ok := guidefs.Containers[clazz]; ok {
return match.Edit(o, props)
}

return nil
}
Expand All @@ -38,6 +50,12 @@ func GoStringFor(o fyne.CanvasObject, props map[fyne.CanvasObject]map[string]str
if match, ok := guidefs.Widgets[name]; ok {
return match.Gostring(o, props, defs)
}
if match, ok := guidefs.Collections[name]; ok {
return match.Gostring(o, props, defs)
}
if match, ok := guidefs.Containers[name]; ok {
return match.Gostring(o, props, defs)
}

return ""
}
Expand Down

0 comments on commit 63bbe73

Please sign in to comment.