mirror of
https://github.com/Ranchero-Software/NetNewsWire.git
synced 2024-12-19 21:13:22 +01:00
adds keyboard shortcuts
- toggle side bar on timeline - toggle readers view on article - go to settings on global
This commit is contained in:
parent
e648623183
commit
a9aefd252e
@ -250,6 +250,10 @@ class ArticleViewController: UIViewController {
|
||||
@IBAction func showActivityDialog(_ sender: Any) {
|
||||
currentWebViewController?.showActivityDialog(popOverBarButtonItem: actionBarButtonItem)
|
||||
}
|
||||
|
||||
@objc func toggleReaderView(_ sender: Any?) {
|
||||
currentWebViewController?.toggleArticleExtractor()
|
||||
}
|
||||
|
||||
// MARK: Keyboard Shortcuts
|
||||
@objc func navigateToTimeline(_ sender: Any?) {
|
||||
|
@ -138,6 +138,9 @@ private extension KeyboardManager {
|
||||
let goToStarredTitle = NSLocalizedString("Go To Starred", comment: "Go To Starred")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: goToStarredTitle, action: "goToStarred:", input: "3", modifiers: [.command]))
|
||||
|
||||
let gotoSettings = NSLocalizedString("Go To Settings", comment: "Go To Settings")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: gotoSettings, action: "goToSettings:", input: ",", modifiers: [.command]))
|
||||
|
||||
let articleSearchTitle = NSLocalizedString("Article Search", comment: "Article Search")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: articleSearchTitle, action: "articleSearch:", input: "f", modifiers: [.command, .alternate]))
|
||||
|
||||
@ -186,6 +189,12 @@ 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 toggleSidebar = NSLocalizedString("Toggle Sidebar", comment: "Toggle Sidebar")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: toggleSidebar, action: "toggleSidebar:", input: "s", modifiers: [.command, .control]))
|
||||
|
||||
let toggleReaderView = NSLocalizedString("Toggle Reader View", comment: "Toggle Reader View")
|
||||
keys.append(KeyboardManager.createKeyCommand(title: toggleReaderView, action: "toggleReaderView:", input: "r", modifiers: [.command, .shift]))
|
||||
|
||||
return keys
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,11 @@ class MasterTimelineViewController: UITableViewController, UndoableCommandRunner
|
||||
@objc func showFeedInspector(_ sender: UITapGestureRecognizer) {
|
||||
coordinator.showFeedInspector()
|
||||
}
|
||||
|
||||
|
||||
@objc func toggleSidebar(_ sender: Any?) {
|
||||
coordinator.toggleSidebar()
|
||||
}
|
||||
|
||||
// MARK: API
|
||||
|
||||
func restoreSelectionIfNecessary(adjustScroll: Bool) {
|
||||
|
@ -121,7 +121,11 @@ class RootSplitViewController: UISplitViewController {
|
||||
@objc func goToStarred(_ sender: Any?) {
|
||||
coordinator.selectStarredFeed()
|
||||
}
|
||||
|
||||
|
||||
@objc func goToSettings(_ sender: Any?) {
|
||||
coordinator.showSettings()
|
||||
}
|
||||
|
||||
@objc func toggleRead(_ sender: Any?) {
|
||||
coordinator.toggleReadForCurrentArticle()
|
||||
}
|
||||
|
@ -1199,7 +1199,10 @@ class SceneCoordinator: NSObject, UndoableCommandRunner, UnreadCountProvider {
|
||||
func navigateToDetail() {
|
||||
articleViewController?.focus()
|
||||
}
|
||||
|
||||
|
||||
func toggleSidebar() {
|
||||
rootSplitViewController.preferredDisplayMode = rootSplitViewController.displayMode == .allVisible ? .primaryHidden : .allVisible
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: UISplitViewControllerDelegate
|
||||
|
Loading…
Reference in New Issue
Block a user