fix(ui): Enable word wrapping for hint labels in convert module
Issue: - User reported hint text being cut off at window edge - Example: "CBR mode: Constant bitrate - predictable file quality. Use for strict size requirements or s" - Text truncated with "or s" visible, rest cut off - Hint labels weren't wrapping properly in narrow windows Root Cause: - Hint labels had TextWrapWord enabled BUT - Labels inside VBox containers don't wrap properly without width constraints - Fyne requires labels to be in a sized container for wrapping to work - VScroll container doesn't provide width hints to child labels Solution: - Wrap all hint labels in container.NewPadded() containers - Padded containers provide proper sizing context for text wrapping - Labels now wrap at available width instead of extending beyond bounds Affected Hint Labels: - encoderPresetHint: Encoder preset descriptions - encodingHint: Bitrate mode (CRF/CBR/VBR/Target Size) hints - frameRateHint: Frame rate change warnings - outputHint: Output file path display - targetAspectHint: Aspect ratio selection hint - hwAccelHint: Hardware acceleration guidance Implementation: - Created *Container versions of each hint label - Wrapped label in container.NewPadded(label) - Replaced direct label usage with container in VBox layouts - Maintains TextWrapWord setting on all labels Impact: - Hint text now wraps properly in narrow windows/panels - No more truncated text - Better readability across all window sizes - Consistent behavior for all hint labels Files Changed: - main.go: Wrapped 6 hint labels in padded containers Reported-by: User (screenshot showing "or s" truncation) Tested: Build successful (v0.1.0-dev20) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
8f73913817
commit
1051329763
29
main.go
29
main.go
|
|
@ -6235,6 +6235,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
outputHint := widget.NewLabel(fmt.Sprintf("Output file: %s", state.convert.OutputFile()))
|
outputHint := widget.NewLabel(fmt.Sprintf("Output file: %s", state.convert.OutputFile()))
|
||||||
outputHint.Wrapping = fyne.TextWrapWord
|
outputHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
outputHintContainer := container.NewPadded(outputHint)
|
||||||
|
|
||||||
// DVD-specific aspect ratio selector (only shown for DVD formats)
|
// DVD-specific aspect ratio selector (only shown for DVD formats)
|
||||||
dvdAspectSelect := widget.NewSelect([]string{"4:3", "16:9"}, func(value string) {
|
dvdAspectSelect := widget.NewSelect([]string{"4:3", "16:9"}, func(value string) {
|
||||||
|
|
@ -6633,6 +6635,9 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
targetAspectSelect.SetSelected(state.convert.OutputAspect)
|
targetAspectSelect.SetSelected(state.convert.OutputAspect)
|
||||||
targetAspectHint := widget.NewLabel("Pick desired output aspect (default Source).")
|
targetAspectHint := widget.NewLabel("Pick desired output aspect (default Source).")
|
||||||
|
targetAspectHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
targetAspectHintContainer := container.NewPadded(targetAspectHint)
|
||||||
|
|
||||||
aspectOptions := widget.NewRadioGroup([]string{"Auto", "Crop", "Letterbox", "Pillarbox", "Blur Fill", "Stretch"}, func(value string) {
|
aspectOptions := widget.NewRadioGroup([]string{"Auto", "Crop", "Letterbox", "Pillarbox", "Blur Fill", "Stretch"}, func(value string) {
|
||||||
logging.Debug(logging.CatUI, "aspect handling set to %s", value)
|
logging.Debug(logging.CatUI, "aspect handling set to %s", value)
|
||||||
|
|
@ -6776,6 +6781,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
// Encoder Preset with hint
|
// Encoder Preset with hint
|
||||||
encoderPresetHint := widget.NewLabel("")
|
encoderPresetHint := widget.NewLabel("")
|
||||||
encoderPresetHint.Wrapping = fyne.TextWrapWord
|
encoderPresetHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
encoderPresetHintContainer := container.NewPadded(encoderPresetHint)
|
||||||
|
|
||||||
updateEncoderPresetHint := func(preset string) {
|
updateEncoderPresetHint := func(preset string) {
|
||||||
var hint string
|
var hint string
|
||||||
|
|
@ -7458,6 +7465,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
|
|
||||||
encodingHint := widget.NewLabel("")
|
encodingHint := widget.NewLabel("")
|
||||||
encodingHint.Wrapping = fyne.TextWrapWord
|
encodingHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
encodingHintContainer := container.NewPadded(encodingHint)
|
||||||
|
|
||||||
applyBitratePreset = func(label string) {
|
applyBitratePreset = func(label string) {
|
||||||
preset, ok := bitratePresetLookup[label]
|
preset, ok := bitratePresetLookup[label]
|
||||||
|
|
@ -7612,6 +7621,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
// Frame Rate with hint
|
// Frame Rate with hint
|
||||||
frameRateHint := widget.NewLabel("")
|
frameRateHint := widget.NewLabel("")
|
||||||
frameRateHint.Wrapping = fyne.TextWrapWord
|
frameRateHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
frameRateHintContainer := container.NewPadded(frameRateHint)
|
||||||
|
|
||||||
updateFrameRateHint := func() {
|
updateFrameRateHint := func() {
|
||||||
if src == nil {
|
if src == nil {
|
||||||
|
|
@ -7694,6 +7705,8 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
// Hardware Acceleration with hint
|
// Hardware Acceleration with hint
|
||||||
hwAccelHint := widget.NewLabel("Auto picks the best GPU path; if encode fails, switch to none (software).")
|
hwAccelHint := widget.NewLabel("Auto picks the best GPU path; if encode fails, switch to none (software).")
|
||||||
hwAccelHint.Wrapping = fyne.TextWrapWord
|
hwAccelHint.Wrapping = fyne.TextWrapWord
|
||||||
|
// Wrap hint in padded container to ensure proper text wrapping in narrow windows
|
||||||
|
hwAccelHintContainer := container.NewPadded(hwAccelHint)
|
||||||
hwAccelSelect := widget.NewSelect([]string{"auto", "none", "nvenc", "amf", "vaapi", "qsv", "videotoolbox"}, func(value string) {
|
hwAccelSelect := widget.NewSelect([]string{"auto", "none", "nvenc", "amf", "vaapi", "qsv", "videotoolbox"}, func(value string) {
|
||||||
state.convert.HardwareAccel = value
|
state.convert.HardwareAccel = value
|
||||||
logging.Debug(logging.CatUI, "hardware accel set to %s", value)
|
logging.Debug(logging.CatUI, "hardware accel set to %s", value)
|
||||||
|
|
@ -8002,7 +8015,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
dvdAspectBox, // DVD options appear here when DVD format selected
|
dvdAspectBox, // DVD options appear here when DVD format selected
|
||||||
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
outputEntry,
|
outputEntry,
|
||||||
outputHint,
|
outputHintContainer,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
simpleEncodingSection,
|
simpleEncodingSection,
|
||||||
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
|
|
@ -8012,7 +8025,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
motionInterpCheck,
|
motionInterpCheck,
|
||||||
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
targetAspectSelectSimple,
|
targetAspectSelectSimple,
|
||||||
targetAspectHint,
|
targetAspectHintContainer,
|
||||||
layout.NewSpacer(),
|
layout.NewSpacer(),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -8023,25 +8036,25 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
videoCodecSelect,
|
videoCodecSelect,
|
||||||
widget.NewLabelWithStyle("Encoder Preset (speed vs quality)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Encoder Preset (speed vs quality)", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
encoderPresetSelect,
|
encoderPresetSelect,
|
||||||
encoderPresetHint,
|
encoderPresetHintContainer,
|
||||||
qualitySectionAdv,
|
qualitySectionAdv,
|
||||||
widget.NewLabelWithStyle("Bitrate Mode", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Bitrate Mode", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
bitrateModeSelect,
|
bitrateModeSelect,
|
||||||
crfContainer,
|
crfContainer,
|
||||||
bitrateContainer,
|
bitrateContainer,
|
||||||
targetSizeContainer,
|
targetSizeContainer,
|
||||||
encodingHint,
|
encodingHintContainer,
|
||||||
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Resolution", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
resolutionSelect,
|
resolutionSelect,
|
||||||
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Frame Rate", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
frameRateSelect,
|
frameRateSelect,
|
||||||
frameRateHint,
|
frameRateHintContainer,
|
||||||
motionInterpCheck,
|
motionInterpCheck,
|
||||||
widget.NewLabelWithStyle("Pixel Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Pixel Format", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
pixelFormatSelect,
|
pixelFormatSelect,
|
||||||
widget.NewLabelWithStyle("Hardware Acceleration", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Hardware Acceleration", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
hwAccelSelect,
|
hwAccelSelect,
|
||||||
hwAccelHint,
|
hwAccelHintContainer,
|
||||||
twoPassCheck,
|
twoPassCheck,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -8064,7 +8077,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
dvdAspectBox, // DVD options appear here when DVD format selected
|
dvdAspectBox, // DVD options appear here when DVD format selected
|
||||||
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Output Name", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
outputEntry,
|
outputEntry,
|
||||||
outputHint,
|
outputHintContainer,
|
||||||
coverDisplay,
|
coverDisplay,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
advancedVideoEncodingBlock,
|
advancedVideoEncodingBlock,
|
||||||
|
|
@ -8073,7 +8086,7 @@ func buildConvertView(state *appState, src *videoSource) fyne.CanvasObject {
|
||||||
widget.NewLabelWithStyle("═══ ASPECT RATIO ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("═══ ASPECT RATIO ═══", fyne.TextAlignCenter, fyne.TextStyle{Bold: true}),
|
||||||
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
widget.NewLabelWithStyle("Target Aspect Ratio", fyne.TextAlignLeading, fyne.TextStyle{Bold: true}),
|
||||||
targetAspectSelect,
|
targetAspectSelect,
|
||||||
targetAspectHint,
|
targetAspectHintContainer,
|
||||||
aspectBox,
|
aspectBox,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user