Skip to content

Commit d656e49

Browse files
authored
feat: implement keyboard shortcuts helpers to VPNMenu() (#244)
1 parent b3d3bf0 commit d656e49

1 file changed

Lines changed: 14 additions & 4 deletions

File tree

Coder-Desktop/Coder-Desktop/Views/VPN/VPNMenu.swift

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,14 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
8686
openSettings()
8787
appActivate()
8888
} label: {
89-
ButtonRowView { Text("Settings") }
90-
}.buttonStyle(.plain)
89+
ButtonRowView {
90+
HStack {
91+
Text("Settings")
92+
Spacer()
93+
Text("⌘,").foregroundStyle(.secondary)
94+
}
95+
}
96+
}.buttonStyle(.plain).keyboardShortcut(",", modifiers: [.command])
9197
Button {
9298
About.open()
9399
} label: {
@@ -100,9 +106,13 @@ struct VPNMenu<VPN: VPNService, FS: FileSyncDaemon>: View {
100106
NSApp.terminate(nil)
101107
} label: {
102108
ButtonRowView {
103-
Text("Quit")
109+
HStack {
110+
Text("Quit")
111+
Spacer()
112+
Text("⌘Q").foregroundStyle(.secondary)
113+
}
104114
}
105-
}.buttonStyle(.plain)
115+
}.buttonStyle(.plain).keyboardShortcut("q", modifiers: [.command])
106116
}.padding([.horizontal, .bottom], Theme.Size.trayMargin)
107117
}.padding(.bottom, Theme.Size.trayMargin)
108118
.environmentObject(vpn)

0 commit comments

Comments
 (0)