mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Add menu command and keyboard shortcut to move focus to the search field.
This commit is contained in:
@@ -195,8 +195,11 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations, NSW
|
||||
return canShowShareMenu()
|
||||
}
|
||||
|
||||
if item.action == #selector(toggleSidebar(_:)) {
|
||||
if item.action == #selector(moveFocusToSearchField(_:)) {
|
||||
return currentSearchField != nil
|
||||
}
|
||||
|
||||
if item.action == #selector(toggleSidebar(_:)) {
|
||||
guard let splitViewItem = sidebarSplitViewItem else {
|
||||
return false
|
||||
}
|
||||
@@ -354,6 +357,12 @@ class MainWindowController : NSWindowController, NSUserInterfaceValidations, NSW
|
||||
sharingServicePicker.show(relativeTo: view.bounds, of: view, preferredEdge: .minY)
|
||||
}
|
||||
|
||||
@IBAction func moveFocusToSearchField(_ sender: Any?) {
|
||||
guard let searchField = currentSearchField else {
|
||||
return
|
||||
}
|
||||
window?.makeFirstResponder(searchField)
|
||||
}
|
||||
}
|
||||
|
||||
// MARK: - SidebarDelegate
|
||||
|
||||
Reference in New Issue
Block a user