chore: release 0.11.2 with window persistence, appID update, and doc fixes
- Persist window size on quit/close and restore it on next launch - Update appID from ru.mixdep.gosentry.desktop to ru.mixeme.gosentry.desktop - Use markdown headers for Build sections in DEVELOPMENT.md - Remove stale go.yaml.in/yaml/v4 dependency from DEVELOPMENT.md Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+5
-2
@@ -11,7 +11,7 @@ import (
|
||||
fyneapp "fyne.io/fyne/v2/app"
|
||||
)
|
||||
|
||||
const appID = "ru.mixdep.gosentry.desktop"
|
||||
const appID = "ru.mixeme.gosentry.desktop"
|
||||
|
||||
// Run is the application entry point. It owns the process lifecycle — single
|
||||
// instance arbitration, Fyne app + window construction, tray wiring, and the
|
||||
@@ -48,7 +48,10 @@ func Run(startInTray bool) {
|
||||
|
||||
w := a.NewWindow("GoSentry " + app.Version)
|
||||
configureSystemTray(a, w)
|
||||
w.Resize(fyne.NewSize(1024, 660))
|
||||
prefs := a.Preferences()
|
||||
winW := float32(prefs.FloatWithFallback("window.width", 1024))
|
||||
winH := float32(prefs.FloatWithFallback("window.height", 660))
|
||||
w.Resize(fyne.NewSize(winW, winH))
|
||||
content, recordStartup := newMainView(w)
|
||||
w.SetContent(content)
|
||||
serveSingleInstance(instanceListener, w)
|
||||
|
||||
@@ -33,7 +33,14 @@ func configureSystemTray(a fyne.App, w fyne.Window) {
|
||||
// Russian system) because it only recognizes an existing quit by matching the
|
||||
// localized label — which our literal "Quit" does not. Setting IsQuit makes
|
||||
// Fyne reuse this item instead of adding a duplicate, regardless of locale.
|
||||
saveWindowSize := func() {
|
||||
size := w.Canvas().Size()
|
||||
prefs := a.Preferences()
|
||||
prefs.SetFloat("window.width", float64(size.Width))
|
||||
prefs.SetFloat("window.height", float64(size.Height))
|
||||
}
|
||||
quit := fyne.NewMenuItem("Quit", func() {
|
||||
saveWindowSize()
|
||||
a.Quit()
|
||||
})
|
||||
quit.IsQuit = true
|
||||
@@ -51,6 +58,7 @@ func configureSystemTray(a fyne.App, w fyne.Window) {
|
||||
// Closing hides the window instead of quitting because scheduler tools are
|
||||
// expected to keep working in the background. The explicit Quit tray item
|
||||
// remains the way to stop the process.
|
||||
saveWindowSize()
|
||||
w.Hide()
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user