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

52 lines
1.4 KiB
Go

// Package layout defines the various layouts available to Fyne apps.
package layout // import "fyne.io/fyne/v2/layout"
import "fyne.io/fyne/v2"
// Declare conformity with Layout interface
var _ fyne.Layout = (*stackLayout)(nil)
type stackLayout struct{}
// NewStackLayout returns a new StackLayout instance. Objects are stacked
// on top of each other with later objects on top of those before.
// Having only a single object has no impact as CanvasObjects will
// fill the available space even without a Stack.
//
// Since: 2.4
func NewStackLayout() fyne.Layout {
return stackLayout{}
}
// NewMaxLayout creates a new MaxLayout instance
//
// Deprecated: Use layout.NewStackLayout() instead.
func NewMaxLayout() fyne.Layout {
return NewStackLayout()
}
// Layout is called to pack all child objects into a specified size.
// For StackLayout this sets all children to the full size passed.
func (m stackLayout) Layout(objects []fyne.CanvasObject, size fyne.Size) {
topLeft := fyne.NewPos(0, 0)
for _, child := range objects {
child.Resize(size)
child.Move(topLeft)
}
}
// MinSize finds the smallest size that satisfies all the child objects.
// For StackLayout this is determined simply as the MinSize of the largest child.
func (m stackLayout) MinSize(objects []fyne.CanvasObject) fyne.Size {
minSize := fyne.NewSize(0, 0)
for _, child := range objects {
if !child.Visible() {
continue
}
minSize = minSize.Max(child.MinSize())
}
return minSize
}