VideoTools/vendor/fyne.io/fyne/v2/layout/paddedlayout.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

45 lines
1.2 KiB
Go

package layout
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
// Declare conformity with Layout interface
var _ fyne.Layout = (*paddedLayout)(nil)
type paddedLayout struct{}
// Layout is called to pack all child objects into a specified size.
// For PaddedLayout this sets all children to the full size passed minus padding all around.
func (l paddedLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
padding := theme.Padding()
pos := fyne.NewSquareOffsetPos(padding)
siz := fyne.NewSize(size.Width-2*padding, size.Height-2*padding)
for _, child := range objects {
child.Resize(siz)
child.Move(pos)
}
}
// MinSize finds the smallest size that satisfies all the child objects.
// For PaddedLayout this is determined simply as the MinSize of the largest child plus padding all around.
func (l paddedLayout) MinSize(objects []fyne.CanvasObject) (min fyne.Size) {
for _, child := range objects {
if !child.Visible() {
continue
}
min = min.Max(child.MinSize())
}
min = min.Add(fyne.NewSquareSize(2 * theme.Padding()))
return min
}
// NewPaddedLayout creates a new PaddedLayout instance
//
// Since: 1.4
func NewPaddedLayout() fyne.Layout {
return paddedLayout{}
}