Compare commits

...

2 Commits

Author SHA1 Message Date
3b99cad32b fix(ui): Move filename to separate row in metadata panel
Fixed filename overlapping with video codec information:
- Moved filename to its own full-width row at the top
- Two-column grid now starts below filename
- Prevents long filenames from overlapping with right column data
- Improves readability of metadata panel

This addresses the issue where long filenames like "She's So Small 12 Scene 3 Dillion Harper.mp4" would run into "Video Codec: h264" on the same line.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 12:13:58 -05:00
41e08b18a7 fix(ui): Add adaptive text color for module tiles accessibility
Implemented automatic text color adaptation based on background brightness to improve readability:
- Added getContrastColor() function using WCAG luminance formula
- Bright modules (Trim/yellow, Audio/amber, Subtitles/light-green) now use dark text
- Dark modules continue using light text
- Ensures high contrast ratio for all module tiles
- Prevents eye strain from low-contrast combinations

This fixes the accessibility issue where bright yellow, amber, and light green modules had poor legibility with white text.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 09:28:58 -05:00
2 changed files with 27 additions and 6 deletions

View File

@ -127,9 +127,27 @@ func (m *ModuleTile) Dropped(pos fyne.Position, items []fyne.URI) {
}
}
// getContrastColor returns black or white text color based on background brightness
func getContrastColor(bgColor color.Color) color.Color {
r, g, b, _ := bgColor.RGBA()
// Convert from 16-bit to 8-bit
r8 := float64(r >> 8)
g8 := float64(g >> 8)
b8 := float64(b >> 8)
// Calculate relative luminance (WCAG formula)
luminance := (0.2126*r8 + 0.7152*g8 + 0.0722*b8) / 255.0
// If bright background, use dark text; if dark background, use light text
if luminance > 0.5 {
return color.NRGBA{R: 20, G: 20, B: 20, A: 255} // Dark text
}
return TextColor // Light text
}
func (m *ModuleTile) CreateRenderer() fyne.WidgetRenderer {
tileColor := m.color
labelColor := TextColor
labelColor := getContrastColor(m.color)
// Dim disabled tiles
if !m.enabled {
@ -137,9 +155,7 @@ func (m *ModuleTile) CreateRenderer() fyne.WidgetRenderer {
if c, ok := m.color.(color.NRGBA); ok {
tileColor = color.NRGBA{R: c.R / 3, G: c.G / 3, B: c.B / 3, A: c.A}
}
if c, ok := TextColor.(color.NRGBA); ok {
labelColor = color.NRGBA{R: c.R / 2, G: c.G / 2, B: c.B / 2, A: c.A}
}
labelColor = color.NRGBA{R: 100, G: 100, B: 100, A: 255}
}
bg := canvas.NewRectangle(tileColor)

View File

@ -9158,9 +9158,11 @@ Metadata: %s`,
return container.NewHBox(keyLabel, valueLabel)
}
// Filename gets its own full-width row to prevent overlap
fileRow := makeRow("File", src.DisplayName)
// Organize metadata into a compact two-column grid
col1 := container.NewVBox(
makeRow("File", src.DisplayName),
makeRow("Format", utils.FirstNonEmpty(src.Format, "Unknown")),
makeRow("Resolution", fmt.Sprintf("%dx%d", src.Width, src.Height)),
makeRow("Aspect Ratio", src.AspectRatioString()),
@ -9187,7 +9189,10 @@ Metadata: %s`,
// Add spacing between the two columns
spacer := layout.NewSpacer()
info := container.NewHBox(col1, spacer, col2)
twoColGrid := container.NewHBox(col1, spacer, col2)
// Combine filename row with two-column grid
info := container.NewVBox(fileRow, twoColGrid)
// Copy metadata button - beside header text
copyBtn := widget.NewButton("📋", func() {