3 struct MapCommands: Commands {
5 @AppStorage("viewStyle") var viewStyle: ViewStyle = .horizontal
6 @AppStorage("zoom") var zoom = 1.0
8 var body: some Commands {
12 CommandGroup(after: CommandGroupPlacement.toolbar) {
13 if viewStyle == .horizontal {
14 Button("Use Vertical Layout") {
17 "l", modifiers: EventModifiers([.command])
20 Button("Use Horizontal Layout") {
21 viewStyle = .horizontal
23 "l", modifiers: EventModifiers([.command])
28 zoom = min(Constants.kMaxZoom, zoom + 0.1)
30 "+", modifiers: EventModifiers([.command])
33 zoom = max(Constants.kMinZoom, zoom - 0.1)
35 "-", modifiers: EventModifiers([.command])
40 CommandGroup(replacing: CommandGroupPlacement.help) {
41 Button("Map Help") { NSWorkspace.shared.open(URL(string: "https://map.tranquil.systems")!) }