Skip to content

Commit

Permalink
Update to correctly set theme on playground render
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Sep 21, 2019
1 parent 3d85f6b commit 3f960ac
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions tools/playground/playground.go
Expand Up @@ -8,8 +8,8 @@ import (
"image/png"

"fyne.io/fyne"
"fyne.io/fyne/internal/app"
"fyne.io/fyne/theme"
"fyne.io/fyne/tools"
)

func imageToPlayground(img image.Image) {
Expand All @@ -36,9 +36,10 @@ func RenderWindow(w fyne.Window) {

// Render takes a canvasobject and converts it into an inline image for showing in the playground
func Render(obj fyne.CanvasObject) {
c := tools.NewSoftwareCanvas()
fyne.CurrentApp().Settings().SetTheme(theme.DarkTheme())

c := NewSoftwareCanvas()
c.SetContent(obj)

fyne.CurrentApp().Settings().SetTheme(theme.DarkTheme())
app.ApplyThemeTo(obj, c)
RenderCanvas(c)
}
@@ -1,4 +1,4 @@
package tools
package playground

import (
"fyne.io/fyne/internal/painter/software"
Expand Down

0 comments on commit 3f960ac

Please sign in to comment.