Command + I can be used to get info on a feed for a timeline or an article. Fixes #2104

This commit is contained in:
Kiel Gillard 🤪 2020-05-26 14:51:42 +10:00
parent 3ce20e26ff
commit 9d7ebf8dfa
4 changed files with 14 additions and 2 deletions

View File

@ -168,6 +168,9 @@ private extension KeyboardManager {
let nextDownTitle = NSLocalizedString("Select Next Down", comment: "Select Next Down")
keys.append(KeyboardManager.createKeyCommand(title: nextDownTitle, action: "selectNextDown:", input: UIKeyCommand.inputDownArrow, modifiers: []))
let getFeedInfo = NSLocalizedString("Get Feed Info", comment: "Get Feed Info")
keys.append(KeyboardManager.createKeyCommand(title: getFeedInfo, action: "showFeedInspector:", input: "i", modifiers: .command))
return keys
}
@ -192,6 +195,9 @@ private extension KeyboardManager {
let toggleStarredTitle = NSLocalizedString("Toggle Starred Status", comment: "Toggle Starred Status")
keys.append(KeyboardManager.createKeyCommand(title: toggleStarredTitle, action: "toggleStarred:", input: "l", modifiers: [.command, .shift]))
let getFeedInfo = NSLocalizedString("Get Feed Info", comment: "Get Feed Info")
keys.append(KeyboardManager.createKeyCommand(title: getFeedInfo, action: "showFeedInspector:", input: "i", modifiers: .command))
let toggleSidebar = NSLocalizedString("Toggle Sidebar", comment: "Toggle Sidebar")
keys.append(KeyboardManager.createKeyCommand(title: toggleSidebar, action: "toggleSidebar:", input: "s", modifiers: [.command, .control]))

View File

@ -471,6 +471,10 @@ class MasterFeedViewController: UITableViewController, UndoableCommandRunner {
}
}
@objc func showFeedInspector(_ sender: Any?) {
coordinator.showFeedInspector()
}
// MARK: API
func restoreSelectionIfNecessary(adjustScroll: Bool) {

View File

@ -174,7 +174,7 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
coordinator.navigateToDetail()
}
@objc func showFeedInspector(_ sender: UITapGestureRecognizer) {
@objc func showFeedInspector(_ sender: Any?) {
coordinator.showFeedInspector()
}

View File

@ -1109,7 +1109,9 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
}
func showFeedInspector() {
guard let feed = timelineFeed as? WebFeed else {
let timelineWebFeed = timelineFeed as? WebFeed
let articleFeed = currentArticle?.webFeed
guard let feed = timelineWebFeed ?? articleFeed else {
return
}
showFeedInspector(for: feed)