From 8c666fb4b580ed9cb9dd188bd7cefd9d134f1c31 Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Tue, 6 Jun 2023 06:29:35 -0600 Subject: [PATCH] add ctrl-q and ctrl-w for quit and close window --- main.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/main.go b/main.go index e297563..63c2f60 100644 --- a/main.go +++ b/main.go @@ -418,6 +418,15 @@ func main() { a := app.New() w := a.NewWindow("xintray") + ctrlQ := &desktop.CustomShortcut{KeyName: fyne.KeyQ, Modifier: fyne.KeyModifierControl} + ctrlW := &desktop.CustomShortcut{KeyName: fyne.KeyW, Modifier: fyne.KeyModifierControl} + w.Canvas().AddShortcut(ctrlQ, func(shortcut fyne.Shortcut) { + a.Quit() + }) + w.Canvas().AddShortcut(ctrlW, func(shortcut fyne.Shortcut) { + w.Hide() + }) + tabs := container.NewAppTabs( container.NewTabItemWithIcon("Status", theme.ComputerIcon(), buildCards(status)), )