Merge pull request #577 from vincode-io/Issue-558b

Made it so that tabbing to the timeline selects something.  Issue #558.
This commit is contained in:
Brent Simmons 2019-03-04 16:12:08 -08:00 committed by GitHub
commit 0575d516b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 10 deletions

View File

@ -2,6 +2,12 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array>
<dict>
<key>key</key>
<string>[tab]</string>
<key>action</key>
<string>navigateToTimeline:</string>
</dict>
<dict>
<key>key</key>
<string>,</string>

View File

@ -20,16 +20,6 @@ class TimelineTableView: NSTableView {
}
super.keyDown(with: event)
}
// override func becomeFirstResponder() -> Bool {
// if super.becomeFirstResponder() {
// if selectedRow == -1 && numberOfRows > 0 {
// rs_selectRowAndScrollToVisible(0)
// }
// return true
// }
// return false
// }
// MARK: - NSView

View File

@ -375,6 +375,9 @@ final class TimelineViewController: NSViewController, UndoableCommandRunner {
}
window.makeFirstResponderUnlessDescendantIsFirstResponder(tableView)
if !hasAtLeastOneSelectedArticle && articles.count > 0 {
tableView.rs_selectRowAndScrollToVisible(0)
}
}
// MARK: - Notifications