Skip to content

Commit

Permalink
Include a quit at the bottom of our system tray
Browse files Browse the repository at this point in the history
  • Loading branch information
andydotxyz committed Feb 19, 2024
1 parent 06260cf commit 3c9947f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func setupSystray(a desktop.App, w fyne.Window, store *cityStore) {
}

func setupSystrayMenu(a desktop.App, w fyne.Window, store *cityStore) {
times := make([]*fyne.MenuItem, len(store.list)+2)
times := make([]*fyne.MenuItem, len(store.list)+4)
times[0] = fyne.NewMenuItem("Show Nomad", w.Show)
times[1] = fyne.NewMenuItemSeparator()

Expand All @@ -67,5 +67,9 @@ func setupSystrayMenu(a desktop.App, w fyne.Window, store *cityStore) {
times[i+2] = localTime
}

end := len(store.list) + 2
times[end] = fyne.NewMenuItemSeparator()
times[end+1] = fyne.NewMenuItem("Quit", fyne.CurrentApp().Quit)

a.SetSystemTrayMenu(fyne.NewMenu("Times", times...))
}

0 comments on commit 3c9947f

Please sign in to comment.