add ctrl-q and ctrl-w for quit and close window
This commit is contained in:
parent
09d938fd67
commit
8c666fb4b5
9
main.go
9
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)),
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user