add system tray + close to tray support (no settigs UI yet)

This commit is contained in:
Drew Weymouth
2023-04-06 19:15:11 -07:00
parent 198110d1dc
commit 8086262a8b
3 changed files with 42 additions and 3 deletions
+7 -2
View File
@@ -57,10 +57,15 @@ func main() {
mainWindow.Window.SetCloseIntercept(func() {
myApp.Config.Application.WindowHeight = int(mainWindow.Canvas().Size().Height)
myApp.Config.Application.WindowWidth = int(mainWindow.Canvas().Size().Width)
mainWindow.Window.Close()
if myApp.Config.Application.CloseToSystemTray &&
mainWindow.HaveSystemTray() {
mainWindow.Window.Hide()
} else {
fyneApp.Quit()
}
})
fyneApp.Run()
// shutdown tasks
log.Println("Running shutdown tasks...")
myApp.Shutdown()
}