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