Style convert sections with boxed layout
This commit is contained in:
parent
e9b0f683d2
commit
93d92ba97e
97
main.go
97
main.go
|
|
@ -6897,6 +6897,26 @@ func buildAudioCodecBadge(codecName string) fyne.CanvasObject {
|
||||||
|
|
||||||
func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
convertColor := moduleColor("convert")
|
convertColor := moduleColor("convert")
|
||||||
|
navyBlue := utils.MustHex("#191F35")
|
||||||
|
|
||||||
|
buildConvertBox := func(title string, content fyne.CanvasObject) *fyne.Container {
|
||||||
|
bg := canvas.NewRectangle(navyBlue)
|
||||||
|
bg.CornerRadius = 10
|
||||||
|
bg.StrokeColor = gridColor
|
||||||
|
bg.StrokeWidth = 1
|
||||||
|
body := container.NewVBox(
|
||||||
|
widget.NewLabelWithStyle(title, fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
widget.NewSeparator(),
|
||||||
|
content,
|
||||||
|
)
|
||||||
|
return container.NewMax(bg, container.NewPadded(body))
|
||||||
|
}
|
||||||
|
|
||||||
|
sectionGap := func() fyne.CanvasObject {
|
||||||
|
gap := canvas.NewRectangle(color.Transparent)
|
||||||
|
gap.SetMinSize(fyne.NewSize(0, 10))
|
||||||
|
return gap
|
||||||
|
}
|
||||||
|
|
||||||
// Convert UI State Manager - eliminates sync boolean flags and widget duplication
|
// Convert UI State Manager - eliminates sync boolean flags and widget duplication
|
||||||
type convertUIState struct {
|
type convertUIState struct {
|
||||||
|
|
@ -9263,7 +9283,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
simpleEncodingSection = container.NewVBox(
|
simpleEncodingSection = buildConvertBox("Video Encoding", container.NewVBox(
|
||||||
qualitySectionSimple,
|
qualitySectionSimple,
|
||||||
widget.NewLabelWithStyle("Encoder Speed/Quality", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Encoder Speed/Quality", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
widget.NewLabel("Choose slower for better compression, faster for speed"),
|
widget.NewLabel("Choose slower for better compression, faster for speed"),
|
||||||
|
|
@ -9272,11 +9292,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
widget.NewLabelWithStyle("Bitrate (simple presets)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Bitrate (simple presets)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
simpleBitrateSelect,
|
simpleBitrateSelect,
|
||||||
)
|
))
|
||||||
|
|
||||||
// Simple mode options - minimal controls, aspect locked to Source
|
outputSectionSimple := buildConvertBox("Output", container.NewVBox(
|
||||||
simpleOptions := container.NewVBox(
|
|
||||||
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
formatContainer,
|
formatContainer,
|
||||||
chapterWarningLabel, // Warning when converting chapters to DVD
|
chapterWarningLabel, // Warning when converting chapters to DVD
|
||||||
|
|
@ -9288,16 +9306,31 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
outputNameRow,
|
outputNameRow,
|
||||||
outputHintContainer,
|
outputHintContainer,
|
||||||
appendSuffixCheck,
|
appendSuffixCheck,
|
||||||
widget.NewSeparator(),
|
))
|
||||||
simpleEncodingSection,
|
|
||||||
|
resolutionSectionSimple := buildConvertBox("Resolution & Frame Rate", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
resolutionSelectSimple,
|
resolutionSelectSimple,
|
||||||
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
frameRateSelect,
|
frameRateSelect,
|
||||||
motionInterpCheck,
|
motionInterpCheck,
|
||||||
|
))
|
||||||
|
|
||||||
|
aspectSectionSimple := buildConvertBox("Aspect Ratio", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
targetAspectSelectSimple,
|
targetAspectSelectSimple,
|
||||||
targetAspectHintContainer,
|
targetAspectHintContainer,
|
||||||
|
))
|
||||||
|
|
||||||
|
// Simple mode options - minimal controls, aspect locked to Source
|
||||||
|
simpleOptions := container.NewVBox(
|
||||||
|
outputSectionSimple,
|
||||||
|
sectionGap(),
|
||||||
|
simpleEncodingSection,
|
||||||
|
sectionGap(),
|
||||||
|
resolutionSectionSimple,
|
||||||
|
sectionGap(),
|
||||||
|
aspectSectionSimple,
|
||||||
layout.NewSpacer(),
|
layout.NewSpacer(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -9312,8 +9345,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
10,
|
10,
|
||||||
)
|
)
|
||||||
|
|
||||||
advancedVideoEncodingBlock = container.NewVBox(
|
advancedVideoEncodingBlock = buildConvertBox("Video Encoding", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("═══ VIDEO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
videoCodecRow,
|
videoCodecRow,
|
||||||
videoCodecControls,
|
videoCodecControls,
|
||||||
encoderPresetHintContainer,
|
encoderPresetHintContainer,
|
||||||
|
|
@ -9336,20 +9368,18 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
hwAccelSelect,
|
hwAccelSelect,
|
||||||
hwAccelHintContainer,
|
hwAccelHintContainer,
|
||||||
twoPassCheck,
|
twoPassCheck,
|
||||||
)
|
))
|
||||||
|
|
||||||
audioEncodingSection = container.NewVBox(
|
audioEncodingSection = buildConvertBox("Audio Encoding", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("═══ AUDIO ENCODING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
widget.NewLabelWithStyle("Audio Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Audio Codec", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
audioCodecContainer,
|
audioCodecContainer,
|
||||||
widget.NewLabelWithStyle("Audio Bitrate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Audio Bitrate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
audioBitrateSelect,
|
audioBitrateSelect,
|
||||||
widget.NewLabelWithStyle("Audio Channels", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Audio Channels", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
audioChannelsSelect,
|
audioChannelsSelect,
|
||||||
)
|
))
|
||||||
|
|
||||||
advancedOptions := container.NewVBox(
|
outputSectionAdvanced := buildConvertBox("Output", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("═══ OUTPUT ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
formatContainer,
|
formatContainer,
|
||||||
chapterWarningLabel, // Warning when converting chapters to DVD
|
chapterWarningLabel, // Warning when converting chapters to DVD
|
||||||
|
|
@ -9361,38 +9391,49 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
outputNameRow,
|
outputNameRow,
|
||||||
outputHintContainer,
|
outputHintContainer,
|
||||||
appendSuffixCheck,
|
appendSuffixCheck,
|
||||||
widget.NewSeparator(),
|
))
|
||||||
advancedVideoEncodingBlock,
|
|
||||||
widget.NewSeparator(),
|
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ ASPECT RATIO ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
aspectSectionAdvanced := buildConvertBox("Aspect Ratio", container.NewVBox(
|
||||||
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
targetAspectSelect,
|
targetAspectSelect,
|
||||||
targetAspectHintContainer,
|
targetAspectHintContainer,
|
||||||
aspectBox,
|
aspectBox,
|
||||||
widget.NewSeparator(),
|
))
|
||||||
|
|
||||||
audioEncodingSection,
|
autoCropSection := buildConvertBox("Auto-Crop", container.NewVBox(
|
||||||
widget.NewSeparator(),
|
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ AUTO-CROP ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
|
||||||
autoCropCheck,
|
autoCropCheck,
|
||||||
detectCropView,
|
detectCropView,
|
||||||
autoCropHint,
|
autoCropHint,
|
||||||
widget.NewSeparator(),
|
))
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ VIDEO TRANSFORMATIONS ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
transformSection := buildConvertBox("Video Transformations", container.NewVBox(
|
||||||
flipHorizontalCheck,
|
flipHorizontalCheck,
|
||||||
flipVerticalCheck,
|
flipVerticalCheck,
|
||||||
widget.NewLabelWithStyle("Rotation", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Rotation", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
rotationSelect,
|
rotationSelect,
|
||||||
transformHint,
|
transformHint,
|
||||||
widget.NewSeparator(),
|
))
|
||||||
|
|
||||||
widget.NewLabelWithStyle("═══ DEINTERLACING ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
deinterlaceSection := buildConvertBox("Deinterlacing", container.NewVBox(
|
||||||
analyzeInterlaceView,
|
analyzeInterlaceView,
|
||||||
inverseCheck,
|
inverseCheck,
|
||||||
inverseHint,
|
inverseHint,
|
||||||
|
))
|
||||||
|
|
||||||
|
advancedOptions := container.NewVBox(
|
||||||
|
outputSectionAdvanced,
|
||||||
|
sectionGap(),
|
||||||
|
advancedVideoEncodingBlock,
|
||||||
|
sectionGap(),
|
||||||
|
aspectSectionAdvanced,
|
||||||
|
sectionGap(),
|
||||||
|
audioEncodingSection,
|
||||||
|
sectionGap(),
|
||||||
|
autoCropSection,
|
||||||
|
sectionGap(),
|
||||||
|
transformSection,
|
||||||
|
sectionGap(),
|
||||||
|
deinterlaceSection,
|
||||||
layout.NewSpacer(),
|
layout.NewSpacer(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user