Scale UI for 800x600 window compatibility and improve layout

UI Scaling:
- Reduce module tiles from 220x110 to 160x80
- Reduce title size from 28 to 20
- Reduce queue tile from 160x60 to 140x50 with smaller text
- Reduce section padding from 14 to 8 pixels
- Remove extra padding wrapper around tiles

Header Layout Improvements:
- Use border layout with title on left, controls on right
- Compact button labels: "☰ History" → "☰", "Run Benchmark" → "Benchmark"
- Eliminates wasted space in header

Queue Behavior Fix:
- "Clear Completed" always returns to main menu (not last module)
- "Clear All" always returns to main menu
- Prevents unwanted navigation to convert module after clearing

All changes work together to fit app within 800x600 default window

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

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
Stu Leak 2025-12-20 14:50:45 -05:00
parent 2dae75dd8e
commit 67b838e9ad
3 changed files with 20 additions and 22 deletions

View File

@ -173,7 +173,7 @@ func (r *moduleTileRenderer) Layout(size fyne.Size) {
}
func (r *moduleTileRenderer) MinSize() fyne.Size {
return fyne.NewSize(220, 110)
return fyne.NewSize(160, 80)
}
func (r *moduleTileRenderer) Refresh() {

View File

@ -47,14 +47,14 @@ type HistoryEntry struct {
func BuildMainMenu(modules []ModuleInfo, onModuleClick func(string), onModuleDrop func(string, []fyne.URI), onQueueClick func(), onLogsClick func(), onBenchmarkClick func(), onBenchmarkHistoryClick func(), onToggleSidebar func(), sidebarVisible bool, sidebar fyne.CanvasObject, titleColor, queueColor, textColor color.Color, queueCompleted, queueTotal int, hasBenchmark bool) fyne.CanvasObject {
title := canvas.NewText("VIDEOTOOLS", titleColor)
title.TextStyle = fyne.TextStyle{Monospace: true, Bold: true}
title.TextSize = 28
title.TextSize = 20
queueTile := buildQueueTile(queueCompleted, queueTotal, queueColor, textColor, onQueueClick)
sidebarToggleBtn := widget.NewButton("☰ History", onToggleSidebar)
sidebarToggleBtn := widget.NewButton("☰", onToggleSidebar)
sidebarToggleBtn.Importance = widget.LowImportance
benchmarkBtn := widget.NewButton("Run Benchmark", onBenchmarkClick)
benchmarkBtn := widget.NewButton("Benchmark", onBenchmarkClick)
// Highlight the benchmark button if no benchmark has been run
if !hasBenchmark {
benchmarkBtn.Importance = widget.HighImportance
@ -62,13 +62,19 @@ func BuildMainMenu(modules []ModuleInfo, onModuleClick func(string), onModuleDro
benchmarkBtn.Importance = widget.LowImportance
}
viewResultsBtn := widget.NewButton("View Results", onBenchmarkHistoryClick)
viewResultsBtn := widget.NewButton("Results", onBenchmarkHistoryClick)
viewResultsBtn.Importance = widget.LowImportance
logsBtn := widget.NewButton("Logs", onLogsClick)
logsBtn.Importance = widget.LowImportance
header := container.NewHBox(title, layout.NewSpacer(), sidebarToggleBtn, benchmarkBtn, viewResultsBtn, logsBtn, queueTile)
// Compact header - title on left, controls on right
header := container.NewBorder(
nil, nil,
title,
container.NewHBox(sidebarToggleBtn, logsBtn, benchmarkBtn, viewResultsBtn, queueTile),
nil,
)
categorized := map[string][]fyne.CanvasObject{}
for i := range modules {
@ -104,7 +110,7 @@ func BuildMainMenu(modules []ModuleInfo, onModuleClick func(string), onModuleDro
}
padding := canvas.NewRectangle(color.Transparent)
padding.SetMinSize(fyne.NewSize(0, 14))
padding.SetMinSize(fyne.NewSize(0, 8))
// Make the sections scrollable
sectionsContent := container.NewVBox(sections...)
@ -130,19 +136,19 @@ func BuildMainMenu(modules []ModuleInfo, onModuleClick func(string), onModuleDro
// buildModuleTile creates a single module tile
func buildModuleTile(mod ModuleInfo, tapped func(), dropped func([]fyne.URI)) fyne.CanvasObject {
logging.Debug(logging.CatUI, "building tile %s color=%v enabled=%v", mod.ID, mod.Color, mod.Enabled)
return container.NewPadded(NewModuleTile(mod.Label, mod.Color, mod.Enabled, tapped, dropped))
return NewModuleTile(mod.Label, mod.Color, mod.Enabled, tapped, dropped)
}
// buildQueueTile creates the queue status tile
func buildQueueTile(completed, total int, queueColor, textColor color.Color, onClick func()) fyne.CanvasObject {
rect := canvas.NewRectangle(queueColor)
rect.CornerRadius = 8
rect.SetMinSize(fyne.NewSize(160, 60))
rect.SetMinSize(fyne.NewSize(140, 50))
text := canvas.NewText(fmt.Sprintf("QUEUE: %d/%d", completed, total), textColor)
text.Alignment = fyne.TextAlignCenter
text.TextStyle = fyne.TextStyle{Monospace: true, Bold: true}
text.TextSize = 18
text.TextSize = 16
tile := container.NewMax(rect, container.NewCenter(text))

16
main.go
View File

@ -1548,13 +1548,9 @@ func (s *appState) refreshQueueView() {
s.jobQueue.Clear()
s.clearVideo()
// If queue is now empty, return to previous module
// Always return to main menu after clearing
if len(s.jobQueue.List()) == 0 {
if s.lastModule != "" && s.lastModule != "queue" {
s.showModule(s.lastModule)
} else {
s.showMainMenu()
}
s.showMainMenu()
} else {
s.refreshQueueView() // Refresh if jobs remain
}
@ -1562,12 +1558,8 @@ func (s *appState) refreshQueueView() {
func() { // onClearAll
s.jobQueue.ClearAll()
s.clearVideo()
// Return to previous module or main menu
if s.lastModule != "" && s.lastModule != "queue" {
s.showModule(s.lastModule)
} else {
s.showMainMenu()
}
// Always return to main menu after clearing all
s.showMainMenu()
},
func(id string) { // onCopyError
job, err := s.jobQueue.Get(id)