Mac: Make shift-space scroll up even when the detail view doesn't have focus

Issue #969.
This commit is contained in:
Nate Weaver
2020-07-10 13:33:25 -05:00
parent 4ba2ab4baa
commit 5acce87995
4 changed files with 41 additions and 0 deletions

View File

@@ -264,6 +264,19 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
}
}
@IBAction func scrollUp(_ sender: Any?) {
guard let detailViewController = detailViewController else {
return
}
detailViewController.canScrollUp { (canScroll) in
if (canScroll) {
NSCursor.setHiddenUntilMouseMoves(true)
detailViewController.scrollPageUp(sender)
}
}
}
@IBAction func openArticleInBrowser(_ sender: Any?) {
if let link = currentLink {
Browser.open(link, invertPreference: NSApp.currentEvent?.modifierFlags.contains(.shift) ?? false)