Fix key command conflicts

This commit is contained in:
James Magahern
2021-03-08 23:53:07 -08:00
parent b88512bc34
commit b550868b50

View File

@@ -45,7 +45,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Focus Web View // Focus Web View
UIKeyCommand( UIKeyCommand(
modifiers: .command, input: "b", modifiers: .command, input: "e",
title: "Focus Web View", title: "Focus Web View",
action: #selector(ShortcutResponder.focusWebView) action: #selector(ShortcutResponder.focusWebView)
), ),
@@ -108,7 +108,7 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
// Toggle Dark Mode // Toggle Dark Mode
UIKeyCommand( UIKeyCommand(
modifiers: [.command], input: "D", modifiers: [.command], input: "M",
title: "Toggle Dark Mode", title: "Toggle Dark Mode",
action: #selector(ShortcutResponder.toggleDarkMode) action: #selector(ShortcutResponder.toggleDarkMode)
), ),
@@ -121,9 +121,11 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
override func buildMenu(with builder: UIMenuBuilder) { override func buildMenu(with builder: UIMenuBuilder) {
builder.replaceChildren(ofMenu: .file) { children in builder.replaceChildren(ofMenu: .file) { children in
return Self.fileMenuShortcuts() + children return Self.fileMenuShortcuts() + children
} }
builder.remove(menu: .format)
builder.replaceChildren(ofMenu: .application, from: { children in builder.replaceChildren(ofMenu: .application, from: { children in
let index = children.firstIndex(where: { elem in let index = children.firstIndex(where: { elem in
if let elem = elem as? UIMenu { if let elem = elem as? UIMenu {