NetNewsWire/Mac/MainWindow/Timeline/TimelineTableView.swift

49 lines
990 B
Swift
Raw Normal View History

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.
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
2017-05-27 19:43:27 +02: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
override func accessibilityLabel() -> String? {
return NSLocalizedString("Timeline", comment: "Timeline")
}
// 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 {
return
2017-05-27 19:43:27 +02:00
}
super.keyDown(with: event)
}
// MARK: - NSView
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()
}
}