VideoTools/vendor/fyne.io/fyne/v2/internal/app/theme.go
Stu Leak 68df790d27 Fix player frame generation and video playback
Major improvements to UnifiedPlayer:

1. GetFrameImage() now works when paused for responsive UI updates
2. Play() method properly starts FFmpeg process
3. Frame display loop runs continuously for smooth video display
4. Disabled audio temporarily to fix video playback fundamentals
5. Simplified FFmpeg command to focus on video stream only

Player now:
- Generates video frames correctly
- Shows video when paused
- Has responsive progress tracking
- Starts playback properly

Next steps: Re-enable audio playback once video is stable
2026-01-07 22:20:00 -05:00

53 lines
1.6 KiB
Go

package app
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/internal/cache"
)
// ApplyThemeTo ensures that the specified canvasobject and all widgets and themeable objects will
// be updated for the current theme.
func ApplyThemeTo(content fyne.CanvasObject, canv fyne.Canvas) {
if content == nil {
return
}
switch o := content.(type) {
case fyne.Widget:
renderer := cache.Renderer(o)
for _, co := range renderer.Objects() {
ApplyThemeTo(co, canv)
}
renderer.Layout(content.Size()) // theme can cause sizing changes
case *fyne.Container:
for _, co := range o.Objects {
ApplyThemeTo(co, canv)
}
if l := o.Layout; l != nil {
l.Layout(o.Objects, o.Size()) // theme can cause sizing changes
}
}
content.Refresh()
}
// ApplySettings ensures that all widgets and themeable objects in an application will be updated for the current theme.
// It also checks that scale changes are reflected if required
func ApplySettings(set fyne.Settings, app fyne.App) {
ApplySettingsWithCallback(set, app, nil)
}
// ApplySettingsWithCallback ensures that all widgets and themeable objects in an application will be updated for the current theme.
// It also checks that scale changes are reflected if required. Also it will call `onEveryWindow` on every window
// interaction
func ApplySettingsWithCallback(set fyne.Settings, app fyne.App, onEveryWindow func(w fyne.Window)) {
for _, window := range app.Driver().AllWindows() {
ApplyThemeTo(window.Content(), window.Canvas())
for _, overlay := range window.Canvas().Overlays().List() {
ApplyThemeTo(overlay, window.Canvas())
}
if onEveryWindow != nil {
onEveryWindow(window)
}
}
}