fix: window minimum, stock spacing layout, sidebar width floor
Part A stages 1-3 of the GUI layout cleanup plan: - Stage 1 (F1-F3): delete settingsControlWidth's redundant wrapper (the Border centre slot already stretches controls), truncate the config path label, and name the default window size so it can be asserted against. Settings no longer widens the window past what it asks for. - Stage 2 (F4-F5): drop compactVBoxLayout for the stock layout.NewCustomPaddedVBoxLayout and a single derived rowOverlap() spacing, replacing three hand-tuned spacing constants. - Stage 3 (F7): delete the inert 400px sidebar width floor; the Border left slot already renders it at content MinSize. See docs/PLAN-gui-layout.md.
This commit is contained in:
+9
-2
@@ -15,6 +15,13 @@ import (
|
||||
|
||||
const appID = "ru.mixeme.gosentry.desktop"
|
||||
|
||||
// defaultWindowWidth and defaultWindowHeight are the size the window opens at
|
||||
// on first launch (later launches restore the last size from preferences).
|
||||
// Fyne enforces the assembled content's MinSize as a hard floor over these, so
|
||||
// they only take effect if the content actually fits within them.
|
||||
const defaultWindowWidth = 1024
|
||||
const defaultWindowHeight = 660
|
||||
|
||||
// Run is the application entry point. It owns the process lifecycle — single
|
||||
// instance arbitration, Fyne app + window construction, tray wiring, and the
|
||||
// startup-timing record — and delegates all view construction to newMainView in
|
||||
@@ -51,8 +58,8 @@ func Run(startInTray bool) {
|
||||
w := a.NewWindow("GoSentry " + app.Version)
|
||||
configureSystemTray(a, w)
|
||||
prefs := a.Preferences()
|
||||
winW := float32(prefs.FloatWithFallback("window.width", 1024))
|
||||
winH := float32(prefs.FloatWithFallback("window.height", 660))
|
||||
winW := float32(prefs.FloatWithFallback("window.width", defaultWindowWidth))
|
||||
winH := float32(prefs.FloatWithFallback("window.height", defaultWindowHeight))
|
||||
w.Resize(fyne.NewSize(winW, winH))
|
||||
svc, err := app.Open()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user