From 834be9edff6e78c4116a3c1ac74458b5f463fba4 Mon Sep 17 00:00:00 2001 From: Martin Nash Date: Wed, 20 May 2020 21:51:41 -0700 Subject: [PATCH] 2099 | Keyboard shortcut to open in browser in background/foreground contrary to user preference. - Add openInBrowserAlternate() function - Add shit-modified entries to to GlobalKeyboardShortcuts.plist to trigger new function --- Mac/MainWindow/MainWindowController.swift | 6 +++++ .../Resources/GlobalKeyboardShortcuts.plist | 24 +++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/Mac/MainWindow/MainWindowController.swift b/Mac/MainWindow/MainWindowController.swift index 01e7335c2..690b57c83 100644 --- a/Mac/MainWindow/MainWindowController.swift +++ b/Mac/MainWindow/MainWindowController.swift @@ -269,6 +269,12 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations { openArticleInBrowser(sender) } + @IBAction func openInBrowserAlternate(_ sender: Any?) { + if let link = currentLink { + Browser.open(link, inBackground: !AppDefaults.openInBrowserInBackground) + } + } + @IBAction func nextUnread(_ sender: Any?) { guard let timelineViewController = currentTimelineViewController, let sidebarViewController = sidebarViewController else { return diff --git a/Shared/Resources/GlobalKeyboardShortcuts.plist b/Shared/Resources/GlobalKeyboardShortcuts.plist index 88e4eac90..8b2bb170e 100644 --- a/Shared/Resources/GlobalKeyboardShortcuts.plist +++ b/Shared/Resources/GlobalKeyboardShortcuts.plist @@ -140,5 +140,29 @@ action toggleStarred: + + key + [enter] + shiftModifier + + action + openInBrowserAlternate: + + + key + [return] + shiftModifier + + action + openInBrowserAlternate: + + + key + B + shiftModifier + + action + openInBrowserAlternate: +