Skip to content

Commit

Permalink
Better defaults for rectangle and richtext editing
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Oct 31, 2024
1 parent 199ff5d commit 0ff7dff
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion internal/guidefs/graphics.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,9 @@ func initGraphics() {
"*canvas.Rectangle": {
Name: "Rectangle",
Create: func() fyne.CanvasObject {
return canvas.NewRectangle(color.Black)
rect := canvas.NewRectangle(color.Black)
rect.StrokeColor = color.Black
return rect
},
Edit: func(obj fyne.CanvasObject, _ map[string]string, _ func([]*widget.FormItem)) []*widget.FormItem {
r := obj.(*canvas.Rectangle)
Expand Down
2 changes: 1 addition & 1 deletion internal/guidefs/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ func initWidgets() {
},
Edit: func(obj fyne.CanvasObject, _ map[string]string, _ func([]*widget.FormItem)) []*widget.FormItem {
r := obj.(*widget.RichText)
entry := widget.NewEntry()
entry := widget.NewMultiLineEntry()
entry.SetText(r.String()) // TODO re-assemble the markdown !?
entry.OnChanged = func(text string) {
r.ParseMarkdown(text)
Expand Down

0 comments on commit 0ff7dff

Please sign in to comment.