Skip to content

Commit

Permalink
Improve icon picker and fix possible load bug
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 26, 2024
1 parent b016f6d commit c38244f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internal/guidefs/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,9 @@ func initWidgets() {
Edit: func(obj fyne.CanvasObject, _ map[string]string, _ func([]*widget.FormItem)) []*widget.FormItem {
i := obj.(*widget.Icon)
return []*widget.FormItem{
widget.NewFormItem("Icon", widget.NewSelect(IconNames, func(selected string) {
i.SetResource(Icons[selected])
}))}
widget.NewFormItem("Icon", newIconSelectorButton(i.Resource, func(res fyne.Resource) {
i.SetResource(res)
}, true))}
},
Gostring: func(obj fyne.CanvasObject, props map[fyne.CanvasObject]map[string]string, defs map[string]string) string {
i := obj.(*widget.Icon)
Expand Down
4 changes: 4 additions & 0 deletions pkg/gui/json.go
Original file line number Diff line number Diff line change
Expand Up @@ -546,6 +546,10 @@ func decodeFields(e reflect.Value, in map[string]interface{}) error {
if res != nil {
f.Set(reflect.ValueOf(res))
}
case "fyne.ThemeSizeName":
if v != nil {
f.Set(reflect.ValueOf(fyne.ThemeSizeName(v.(string))))
}
case "[]*widget.AccordionItem":
var items []*widget.AccordionItem
for _, item := range reflect.ValueOf(v).Interface().([]interface{}) {
Expand Down

0 comments on commit c38244f

Please sign in to comment.