feat: add spacing around Settings tab button row

The Save/Cancel/Defaults row sat flush against the separator above it
and the tab's left edge, tighter than the other vertical gaps in the
tab. Add matching padding spacers to bring it in line.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
mixeme
2026-07-26 14:06:30 +03:00
parent e87840e95b
commit 88511843ce
+14 -1
View File
@@ -1,6 +1,7 @@
package ui package ui
import ( import (
"image/color"
"net/url" "net/url"
"runtime" "runtime"
"runtime/debug" "runtime/debug"
@@ -11,6 +12,7 @@ import (
"gitea.mixdep.ru/mix/gosentry/src/domain" "gitea.mixdep.ru/mix/gosentry/src/domain"
"fyne.io/fyne/v2" "fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/container" "fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/dialog" "fyne.io/fyne/v2/dialog"
"fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/theme"
@@ -274,13 +276,24 @@ func settingsView(w fyne.Window, svc *app.Service) fyne.CanvasObject {
// Wrapping the whole thing in a vertical scroll keeps its minimum height small // Wrapping the whole thing in a vertical scroll keeps its minimum height small
// so it does not dictate the window's minimum height (AppTabs sizes to the // so it does not dictate the window's minimum height (AppTabs sizes to the
// tallest tab) and it scrolls on short 720p screens. // tallest tab) and it scrolls on short 720p screens.
// The button row sits right below the separator's hairline, which reads as
// tighter than the other vertical gaps in the tab (those separate whole
// sections, not a single thin line from a row of buttons). A spacer the
// height of the default padding closes that gap up to match, and a matching
// width spacer indents the buttons from the left edge the same amount.
buttonRowSpacer := canvas.NewRectangle(color.Transparent)
buttonRowSpacer.SetMinSize(fyne.NewSize(0, theme.Padding()))
buttonRowLeftInset := canvas.NewRectangle(color.Transparent)
buttonRowLeftInset.SetMinSize(fyne.NewSize(theme.Padding(), 0))
return container.NewVScroll(container.NewPadded(container.NewVBox( return container.NewVScroll(container.NewPadded(container.NewVBox(
container.NewGridWithColumns(2, leftColumn, rightColumn), container.NewGridWithColumns(2, leftColumn, rightColumn),
widget.NewSeparator(), widget.NewSeparator(),
buttonRowSpacer,
// Save/Cancel/Defaults share one row with the status so an empty status // Save/Cancel/Defaults share one row with the status so an empty status
// (the common case) does not leave a blank line above the separator. The // (the common case) does not leave a blank line above the separator. The
// status appears beside the buttons once a save reports a result. // status appears beside the buttons once a save reports a result.
container.NewHBox(saveSettings, cancelSettings, restoreDefaults, settingsStatus), container.NewHBox(buttonRowLeftInset, saveSettings, cancelSettings, restoreDefaults, settingsStatus),
))) )))
} }