Skip to content

Commit 19dff62

Browse files
committed
update mobile driver too
1 parent ac4e63a commit 19dff62

File tree

1 file changed

+11
-15
lines changed

1 file changed

+11
-15
lines changed

internal/driver/mobile/driver.go

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -169,10 +169,19 @@ func (d *driver) Run() {
169169
app.Main(func(a app.App) {
170170
d.app = a
171171
d.queuedFuncs = async.NewUnboundedChan[func()]()
172-
var pendingSettings fyne.Settings
172+
173173
fyne.CurrentApp().Settings().AddListener(func(s fyne.Settings) {
174-
pendingSettings = s
174+
painter.ClearFontCache()
175+
cache.ResetThemeCaches()
176+
intapp.ApplySettingsWithCallback(s, fyne.CurrentApp(), func(w fyne.Window) {
177+
c, ok := w.Canvas().(*canvas)
178+
if !ok {
179+
return
180+
}
181+
c.applyThemeOutOfTreeObjects()
182+
})
175183
})
184+
176185
draw := time.NewTicker(time.Second / 60)
177186
defer func() {
178187
l := fyne.CurrentApp().Lifecycle().(*intapp.Lifecycle)
@@ -250,19 +259,6 @@ func (d *driver) Run() {
250259
d.typeUpCanvas(c, e.Rune, e.Code, e.Modifiers)
251260
}
252261
}
253-
254-
if pendingSettings != nil {
255-
painter.ClearFontCache()
256-
cache.ResetThemeCaches()
257-
intapp.ApplySettingsWithCallback(pendingSettings, fyne.CurrentApp(), func(w fyne.Window) {
258-
c, ok := w.Canvas().(*canvas)
259-
if !ok {
260-
return
261-
}
262-
c.applyThemeOutOfTreeObjects()
263-
})
264-
pendingSettings = nil
265-
}
266262
}
267263
}
268264
})

0 commit comments

Comments
 (0)