Improve thumbnail settings layout
This commit is contained in:
parent
5cf83f0810
commit
734a50aece
1
main.go
1
main.go
|
|
@ -886,6 +886,7 @@ type appState struct {
|
||||||
thumbWidth int
|
thumbWidth int
|
||||||
thumbContactSheet bool
|
thumbContactSheet bool
|
||||||
thumbShowTimestamps bool
|
thumbShowTimestamps bool
|
||||||
|
thumbSheetWidth int
|
||||||
thumbColumns int
|
thumbColumns int
|
||||||
thumbRows int
|
thumbRows int
|
||||||
thumbLastOutputPath string // Path to last generated output
|
thumbLastOutputPath string // Path to last generated output
|
||||||
|
|
|
||||||
|
|
@ -63,6 +63,9 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
if state.thumbWidth == 0 {
|
if state.thumbWidth == 0 {
|
||||||
state.thumbWidth = 320
|
state.thumbWidth = 320
|
||||||
}
|
}
|
||||||
|
if state.thumbSheetWidth == 0 {
|
||||||
|
state.thumbSheetWidth = 360
|
||||||
|
}
|
||||||
if state.thumbColumns == 0 {
|
if state.thumbColumns == 0 {
|
||||||
state.thumbColumns = 4 // 4 columns works well for widescreen videos
|
state.thumbColumns = 4 // 4 columns works well for widescreen videos
|
||||||
}
|
}
|
||||||
|
|
@ -110,17 +113,29 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
})
|
})
|
||||||
clearBtn.Importance = widget.LowImportance
|
clearBtn.Importance = widget.LowImportance
|
||||||
|
|
||||||
// Contact sheet checkbox
|
// Contact sheet checkbox (wrapped)
|
||||||
contactSheetCheck := widget.NewCheck("Generate Contact Sheet (single image)", func(checked bool) {
|
contactSheetCheck := widget.NewCheck("", func(checked bool) {
|
||||||
state.thumbContactSheet = checked
|
state.thumbContactSheet = checked
|
||||||
state.showThumbView()
|
state.showThumbView()
|
||||||
})
|
})
|
||||||
contactSheetCheck.Checked = state.thumbContactSheet
|
contactSheetCheck.Checked = state.thumbContactSheet
|
||||||
|
contactSheetLabel := widget.NewLabel("Generate Contact Sheet (single image)")
|
||||||
|
contactSheetLabel.Wrapping = fyne.TextWrapWord
|
||||||
|
contactSheetToggle := ui.NewTappable(contactSheetLabel, func() {
|
||||||
|
contactSheetCheck.SetChecked(!contactSheetCheck.Checked)
|
||||||
|
})
|
||||||
|
contactSheetRow := container.NewBorder(nil, nil, contactSheetCheck, nil, contactSheetToggle)
|
||||||
|
|
||||||
timestampCheck := widget.NewCheck("Show timestamps on thumbnails", func(checked bool) {
|
timestampCheck := widget.NewCheck("", func(checked bool) {
|
||||||
state.thumbShowTimestamps = checked
|
state.thumbShowTimestamps = checked
|
||||||
})
|
})
|
||||||
timestampCheck.Checked = state.thumbShowTimestamps
|
timestampCheck.Checked = state.thumbShowTimestamps
|
||||||
|
timestampLabel := widget.NewLabel("Show timestamps on thumbnails")
|
||||||
|
timestampLabel.Wrapping = fyne.TextWrapWord
|
||||||
|
timestampToggle := ui.NewTappable(timestampLabel, func() {
|
||||||
|
timestampCheck.SetChecked(!timestampCheck.Checked)
|
||||||
|
})
|
||||||
|
timestampRow := container.NewBorder(nil, nil, timestampCheck, nil, timestampToggle)
|
||||||
|
|
||||||
// Conditional settings based on contact sheet mode
|
// Conditional settings based on contact sheet mode
|
||||||
var settingsOptions fyne.CanvasObject
|
var settingsOptions fyne.CanvasObject
|
||||||
|
|
@ -132,6 +147,7 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
totalThumbs := state.thumbColumns * state.thumbRows
|
totalThumbs := state.thumbColumns * state.thumbRows
|
||||||
totalLabel := widget.NewLabel(fmt.Sprintf("Total thumbnails: %d", totalThumbs))
|
totalLabel := widget.NewLabel(fmt.Sprintf("Total thumbnails: %d", totalThumbs))
|
||||||
totalLabel.TextStyle = fyne.TextStyle{Italic: true}
|
totalLabel.TextStyle = fyne.TextStyle{Italic: true}
|
||||||
|
totalLabel.Wrapping = fyne.TextWrapWord
|
||||||
|
|
||||||
colSlider := widget.NewSlider(2, 12)
|
colSlider := widget.NewSlider(2, 12)
|
||||||
colSlider.Value = float64(state.thumbColumns)
|
colSlider.Value = float64(state.thumbColumns)
|
||||||
|
|
@ -151,9 +167,39 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
totalLabel.SetText(fmt.Sprintf("Total thumbnails: %d", state.thumbColumns*state.thumbRows))
|
totalLabel.SetText(fmt.Sprintf("Total thumbnails: %d", state.thumbColumns*state.thumbRows))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sizeOptions := []string{"240 px", "300 px", "360 px", "420 px", "480 px"}
|
||||||
|
sizeSelect := widget.NewSelect(sizeOptions, func(val string) {
|
||||||
|
switch val {
|
||||||
|
case "240 px":
|
||||||
|
state.thumbSheetWidth = 240
|
||||||
|
case "300 px":
|
||||||
|
state.thumbSheetWidth = 300
|
||||||
|
case "360 px":
|
||||||
|
state.thumbSheetWidth = 360
|
||||||
|
case "420 px":
|
||||||
|
state.thumbSheetWidth = 420
|
||||||
|
case "480 px":
|
||||||
|
state.thumbSheetWidth = 480
|
||||||
|
}
|
||||||
|
})
|
||||||
|
switch state.thumbSheetWidth {
|
||||||
|
case 240:
|
||||||
|
sizeSelect.SetSelected("240 px")
|
||||||
|
case 300:
|
||||||
|
sizeSelect.SetSelected("300 px")
|
||||||
|
case 420:
|
||||||
|
sizeSelect.SetSelected("420 px")
|
||||||
|
case 480:
|
||||||
|
sizeSelect.SetSelected("480 px")
|
||||||
|
default:
|
||||||
|
sizeSelect.SetSelected("360 px")
|
||||||
|
}
|
||||||
|
|
||||||
settingsOptions = container.NewVBox(
|
settingsOptions = container.NewVBox(
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
widget.NewLabel("Contact Sheet Grid:"),
|
widget.NewLabel("Contact Sheet Grid:"),
|
||||||
|
widget.NewLabel("Thumbnail Size:"),
|
||||||
|
sizeSelect,
|
||||||
colLabel,
|
colLabel,
|
||||||
colSlider,
|
colSlider,
|
||||||
rowLabel,
|
rowLabel,
|
||||||
|
|
@ -203,7 +249,7 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
if state.thumbContactSheet {
|
if state.thumbContactSheet {
|
||||||
// Contact sheet: count is determined by grid, use larger width for analyzable screenshots
|
// Contact sheet: count is determined by grid, use larger width for analyzable screenshots
|
||||||
count = state.thumbColumns * state.thumbRows
|
count = state.thumbColumns * state.thumbRows
|
||||||
width = 360 // Larger width for contact sheets to improve readability when zooming
|
width = state.thumbSheetWidth
|
||||||
description = fmt.Sprintf("Contact sheet: %dx%d grid (%d thumbnails)", state.thumbColumns, state.thumbRows, count)
|
description = fmt.Sprintf("Contact sheet: %dx%d grid (%d thumbnails)", state.thumbColumns, state.thumbRows, count)
|
||||||
} else {
|
} else {
|
||||||
// Individual thumbnails: use user settings
|
// Individual thumbnails: use user settings
|
||||||
|
|
@ -342,8 +388,8 @@ func buildThumbView(state *appState) fyne.CanvasObject {
|
||||||
settingsPanel := container.NewVBox(
|
settingsPanel := container.NewVBox(
|
||||||
widget.NewLabel("Settings:"),
|
widget.NewLabel("Settings:"),
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
contactSheetCheck,
|
contactSheetRow,
|
||||||
timestampCheck,
|
timestampRow,
|
||||||
settingsOptions,
|
settingsOptions,
|
||||||
widget.NewSeparator(),
|
widget.NewSeparator(),
|
||||||
generateNowBtn,
|
generateNowBtn,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user