From 0ba53701b4cc42f1dc9ec2c7657630b2df2d5918 Mon Sep 17 00:00:00 2001 From: Stu Leak Date: Sat, 13 Dec 2025 20:44:33 -0500 Subject: [PATCH] Make total thumbnails count update dynamically MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixed the total thumbnails label to update in real-time when adjusting columns or rows sliders in contact sheet mode. Changes: - Created totalLabel before sliders so both callbacks can access it - Both column and row slider OnChanged callbacks now update the total - Total recalculates as: columns × rows on each slider change The total now updates immediately as you adjust the grid dimensions, providing instant feedback on how many thumbnails will be generated. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 --- main.go | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/main.go b/main.go index 56d7930..30440d2 100644 --- a/main.go +++ b/main.go @@ -9556,27 +9556,30 @@ func buildThumbView(state *appState) fyne.CanvasObject { if state.thumbContactSheet { // Contact sheet mode: show columns and rows colLabel := widget.NewLabel(fmt.Sprintf("Columns: %d", state.thumbColumns)) + rowLabel := widget.NewLabel(fmt.Sprintf("Rows: %d", state.thumbRows)) + + totalThumbs := state.thumbColumns * state.thumbRows + totalLabel := widget.NewLabel(fmt.Sprintf("Total thumbnails: %d", totalThumbs)) + totalLabel.TextStyle = fyne.TextStyle{Italic: true} + colSlider := widget.NewSlider(2, 12) colSlider.Value = float64(state.thumbColumns) colSlider.Step = 1 colSlider.OnChanged = func(val float64) { state.thumbColumns = int(val) colLabel.SetText(fmt.Sprintf("Columns: %d", int(val))) + totalLabel.SetText(fmt.Sprintf("Total thumbnails: %d", state.thumbColumns*state.thumbRows)) } - rowLabel := widget.NewLabel(fmt.Sprintf("Rows: %d", state.thumbRows)) rowSlider := widget.NewSlider(2, 12) rowSlider.Value = float64(state.thumbRows) rowSlider.Step = 1 rowSlider.OnChanged = func(val float64) { state.thumbRows = int(val) rowLabel.SetText(fmt.Sprintf("Rows: %d", int(val))) + totalLabel.SetText(fmt.Sprintf("Total thumbnails: %d", state.thumbColumns*state.thumbRows)) } - totalThumbs := state.thumbColumns * state.thumbRows - totalLabel := widget.NewLabel(fmt.Sprintf("Total thumbnails: %d", totalThumbs)) - totalLabel.TextStyle = fyne.TextStyle{Italic: true} - settingsOptions = container.NewVBox( widget.NewSeparator(), widget.NewLabel("Contact Sheet Grid:"),