diff --git a/IceCubesApp/App/IceCubesApp.swift b/IceCubesApp/App/IceCubesApp.swift index 13a8e8ad..3b10cbd2 100644 --- a/IceCubesApp/App/IceCubesApp.swift +++ b/IceCubesApp/App/IceCubesApp.swift @@ -56,11 +56,7 @@ struct IceCubesApp: App { }) } .commands { - CommandGroup(replacing: CommandGroupPlacement.newItem) { - Button("New post") { - sidebarRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.serverPreferences?.postVisibility ?? .pub) - } - } + appMenu } .onChange(of: scenePhase) { scenePhase in handleScenePhase(scenePhase: scenePhase) @@ -172,6 +168,29 @@ struct IceCubesApp: App { private func refreshPushSubs() { PushNotificationsService.shared.requestPushNotifications() } + + @CommandsBuilder + private var appMenu: some Commands { + CommandGroup(replacing: .newItem) { + Button("New post") { + sidebarRouterPath.presentedSheet = .newStatusEditor(visibility: userPreferences.serverPreferences?.postVisibility ?? .pub) + } + } + CommandGroup(replacing: .textFormatting) { + Menu("Font") { + Button("Bigger") { + if userPreferences.fontSizeScale < 1.5 { + userPreferences.fontSizeScale += 0.1 + } + } + Button("Smaller") { + if userPreferences.fontSizeScale > 0.5 { + userPreferences.fontSizeScale -= 0.1 + } + } + } + } + } } class AppDelegate: NSObject, UIApplicationDelegate { diff --git a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift index b4fc4c30..0aa8cf31 100644 --- a/Packages/Status/Sources/Status/Editor/StatusEditorView.swift +++ b/Packages/Status/Sources/Status/Editor/StatusEditorView.swift @@ -110,6 +110,7 @@ public struct StatusEditorView: View { } } .disabled(!viewModel.canPost) + .keyboardShortcut(.return, modifiers: .command) } ToolbarItem(placement: .navigationBarLeading) { Button { @@ -123,6 +124,7 @@ public struct StatusEditorView: View { } label: { Text("Cancel") } + .keyboardShortcut(.cancelAction) .confirmationDialog("", isPresented: $isDismissAlertPresented, actions: { diff --git a/Packages/Timeline/Sources/Timeline/TimelineView.swift b/Packages/Timeline/Sources/Timeline/TimelineView.swift index 68c999c1..38db47ee 100644 --- a/Packages/Timeline/Sources/Timeline/TimelineView.swift +++ b/Packages/Timeline/Sources/Timeline/TimelineView.swift @@ -115,6 +115,7 @@ public struct TimelineView: View { } label: { Text(viewModel.pendingStatusesButtonTitle) } + .keyboardShortcut("r", modifiers: .command) .buttonStyle(.bordered) .background(.thinMaterial) .cornerRadius(8)