From 32cbd3e28874894608953a610215e4067d9a8bd2 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sun, 4 Jan 2026 05:11:15 -0500 Subject: [PATCH] Clamp player surface to 360px height on 1080p --- main.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/main.go b/main.go index 8837dd0..029669e 100644 --- a/main.go +++ b/main.go @@ -10047,6 +10047,27 @@ func buildVideoPane(state *appState, min fyne.Size, src *videoSource, onCover fu targetWidth := float32(baseWidth) _ = defaultAspect targetHeight := float32(min.Height) + if state != nil && state.window != nil { + winSize := state.window.Canvas().Size() + if winSize.Height >= 900 { + desiredHeight := float32(360) + desiredWidth := desiredHeight / float32(defaultAspect) + maxWidth := winSize.Width - 48 + maxHeight := winSize.Height - 200 + if maxWidth > 0 && desiredWidth > maxWidth { + desiredWidth = maxWidth + desiredHeight = desiredWidth * float32(defaultAspect) + } + if maxHeight > 0 && desiredHeight > maxHeight { + desiredHeight = maxHeight + desiredWidth = desiredHeight / float32(defaultAspect) + } + if desiredWidth > 0 && desiredHeight > 0 { + targetWidth = desiredWidth + targetHeight = desiredHeight + } + } + } // Don't set rigid MinSize - let the outer container be flexible // outer.SetMinSize(fyne.NewSize(targetWidth, targetHeight))