Made it so that tabbing to the timeline selects something. Issue #558.

This commit is contained in:
Maurice Parker 2019-03-04 18:08:53 -06:00
parent 9cc85d6c6f
commit 4518357e09
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