refactor open in app browser with global shortcuts
This commit is contained in:
parent
d671029828
commit
f2cd09aae3
|
@ -106,7 +106,7 @@
|
|||
</dict>
|
||||
<dict>
|
||||
<key>title</key>
|
||||
<string>Open in Browser</string>
|
||||
<string>Open In App Browser</string>
|
||||
<key>key</key>
|
||||
<string>[return]</string>
|
||||
<key>action</key>
|
||||
|
|
|
@ -177,9 +177,6 @@ private extension KeyboardManager {
|
|||
let openInBrowserTitle = NSLocalizedString("Open In Browser", comment: "Open In Browser")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: openInBrowserTitle, action: "openInBrowser:", input: UIKeyCommand.inputRightArrow, modifiers: [.command]))
|
||||
|
||||
let openInAppBrowserTitle = NSLocalizedString("Open In App Browser", comment: "Open In App Browser")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: openInAppBrowserTitle, action: "openArticleInAppBrowser:", input: "\r", modifiers: []))
|
||||
|
||||
let toggleReadTitle = NSLocalizedString("Toggle Read Status", comment: "Toggle Read Status")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: toggleReadTitle, action: "toggleRead:", input: "u", modifiers: [.command, .shift]))
|
||||
|
||||
|
|
|
@ -83,11 +83,7 @@ class RootSplitViewController: UISplitViewController {
|
|||
}
|
||||
|
||||
@objc func openInAppBrowser(_ sender: Any?) {
|
||||
coordinator.showInAppBrowserForCurrentFeed()
|
||||
}
|
||||
|
||||
@objc func openArticleInAppBrowser(_ sender: Any?) {
|
||||
coordinator.showInAppBrowserForCurrentArticle()
|
||||
coordinator.showInAppBrowser()
|
||||
}
|
||||
|
||||
@objc func articleSearch(_ sender: Any?) {
|
||||
|
|
|
@ -1185,15 +1185,16 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
|||
}
|
||||
UIApplication.shared.open(url, options: [:])
|
||||
}
|
||||
|
||||
func showInAppBrowserForCurrentArticle() {
|
||||
articleViewController?.openInAppBrowser()
|
||||
}
|
||||
|
||||
func showInAppBrowserForCurrentFeed() {
|
||||
masterFeedViewController.openInAppBrowser()
|
||||
}
|
||||
|
||||
func showInAppBrowser() {
|
||||
if currentArticle != nil {
|
||||
articleViewController?.openInAppBrowser()
|
||||
}
|
||||
else {
|
||||
masterFeedViewController.openInAppBrowser()
|
||||
}
|
||||
}
|
||||
|
||||
func navigateToFeeds() {
|
||||
masterFeedViewController?.focus()
|
||||
selectArticle(nil)
|
||||
|
|
Loading…
Reference in New Issue