2017-05-27 10:43:27 -07:00
|
|
|
//
|
|
|
|
// TimelineTableView.swift
|
2018-08-28 22:18:24 -07:00
|
|
|
// NetNewsWire
|
2017-05-27 10:43:27 -07:00
|
|
|
//
|
|
|
|
// Created by Brent Simmons on 10/11/16.
|
2017-05-29 13:17:58 -07:00
|
|
|
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
2017-05-27 10:43:27 -07:00
|
|
|
//
|
|
|
|
|
2018-02-02 22:51:32 -08:00
|
|
|
import AppKit
|
2019-04-13 14:34:00 -07:00
|
|
|
import RSCore
|
2017-05-27 10:43:27 -07:00
|
|
|
|
|
|
|
class TimelineTableView: NSTableView {
|
|
|
|
|
2019-02-17 22:00:04 -08:00
|
|
|
weak var keyboardDelegate: KeyboardDelegate?
|
2017-05-27 10:43:27 -07:00
|
|
|
|
2019-09-10 11:09:17 -05:00
|
|
|
override func accessibilityLabel() -> String? {
|
|
|
|
return NSLocalizedString("Timeline", comment: "Timeline")
|
|
|
|
}
|
|
|
|
|
2019-02-07 22:27:26 -08:00
|
|
|
// MARK: - NSResponder
|
2017-05-27 10:43:27 -07:00
|
|
|
|
|
|
|
override func keyDown(with event: NSEvent) {
|
2019-02-17 22:00:04 -08:00
|
|
|
if keyboardDelegate?.keydown(event, in: self) ?? false {
|
2017-12-20 12:59:31 -08:00
|
|
|
return
|
2017-05-27 10:43:27 -07:00
|
|
|
}
|
|
|
|
super.keyDown(with: event)
|
|
|
|
}
|
2019-02-07 22:27:26 -08:00
|
|
|
|
|
|
|
// MARK: - NSView
|
|
|
|
|
2019-05-13 21:42:47 -07:00
|
|
|
override var isOpaque: Bool {
|
|
|
|
return true
|
|
|
|
}
|
|
|
|
|
2017-05-27 10:43:27 -07:00
|
|
|
override func viewWillStartLiveResize() {
|
|
|
|
if let scrollView = self.enclosingScrollView {
|
|
|
|
scrollView.hasVerticalScroller = false
|
|
|
|
}
|
|
|
|
super.viewWillStartLiveResize()
|
|
|
|
}
|
|
|
|
|
|
|
|
override func viewDidEndLiveResize() {
|
|
|
|
if let scrollView = self.enclosingScrollView {
|
|
|
|
scrollView.hasVerticalScroller = true
|
|
|
|
}
|
|
|
|
super.viewDidEndLiveResize()
|
|
|
|
}
|
|
|
|
}
|