Merge pull request #2101 from MartinJNash/mjn/open-in-browser-alternate

2099 | Keyboard shortcut to open in browser with inverted preference
This commit is contained in:
Brent Simmons 2020-05-23 16:02:04 -07:00 committed by GitHub
commit b426ca98be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 30 additions and 0 deletions

View File

@ -269,6 +269,12 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations {
openArticleInBrowser(sender) openArticleInBrowser(sender)
} }
@IBAction func openInBrowserUsingOppositeOfSettings(_ sender: Any?) {
if let link = currentLink {
Browser.open(link, inBackground: !AppDefaults.openInBrowserInBackground)
}
}
@IBAction func nextUnread(_ sender: Any?) { @IBAction func nextUnread(_ sender: Any?) {
guard let timelineViewController = currentTimelineViewController, let sidebarViewController = sidebarViewController else { guard let timelineViewController = currentTimelineViewController, let sidebarViewController = sidebarViewController else {
return return

View File

@ -140,5 +140,29 @@
<key>action</key> <key>action</key>
<string>toggleStarred:</string> <string>toggleStarred:</string>
</dict> </dict>
<dict>
<key>key</key>
<string>[enter]</string>
<key>shiftModifier</key>
<true/>
<key>action</key>
<string>openInBrowserUsingOppositeOfSettings:</string>
</dict>
<dict>
<key>key</key>
<string>[return]</string>
<key>shiftModifier</key>
<true/>
<key>action</key>
<string>openInBrowserUsingOppositeOfSettings:</string>
</dict>
<dict>
<key>key</key>
<string>B</string>
<key>shiftModifier</key>
<true/>
<key>action</key>
<string>openInBrowserUsingOppositeOfSettings:</string>
</dict>
</array> </array>
</plist> </plist>