NetNewsWire/Evergreen/MainWindow/Timeline/TimelineTableView.swift

54 lines
1009 B
Swift
Raw Normal View History

2017-05-27 19:43:27 +02:00
//
// TimelineTableView.swift
// Evergreen
//
// 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
2017-05-27 19:43:27 +02:00
class TimelineTableView: NSTableView {
@IBOutlet var keyboardDelegate: KeyboardDelegate!
2017-05-27 19:43:27 +02:00
//MARK: NSResponder
override func keyDown(with event: NSEvent) {
if keyboardDelegate.keydown(event, in: self) {
return
2017-05-27 19:43:27 +02:00
}
super.keyDown(with: event)
}
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()
}
2017-11-02 06:40:28 +01:00
func redrawGrid() {
guard let rowViews = visibleRowViews() else {
return
}
rowViews.forEach{ (rowView) in
if let rowView = rowView as? TimelineTableRowView {
rowView.invalidateGridRect()
}
}
}
2017-05-27 19:43:27 +02:00
}