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"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<array> <array>
<dict>
<key>key</key>
<string>[tab]</string>
<key>action</key>
<string>navigateToTimeline:</string>
</dict>
<dict> <dict>
<key>key</key> <key>key</key>
<string>,</string> <string>,</string>

View File

@ -21,16 +21,6 @@ class TimelineTableView: NSTableView {
super.keyDown(with: event) 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 // MARK: - NSView
override func viewWillStartLiveResize() { override func viewWillStartLiveResize() {

View File

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