Remove unused code from TimelineTableRowView.
This commit is contained in:
parent
2ece915ac3
commit
7184f8c439
|
@ -10,18 +10,6 @@ import AppKit
|
||||||
|
|
||||||
class TimelineTableRowView : NSTableRowView {
|
class TimelineTableRowView : NSTableRowView {
|
||||||
|
|
||||||
var cellAppearance: TimelineCellAppearance! {
|
|
||||||
didSet {
|
|
||||||
if cellAppearance != oldValue {
|
|
||||||
invalidateGridRect()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// override var interiorBackgroundStyle: NSBackgroundStyle {
|
|
||||||
// return .Light
|
|
||||||
// }
|
|
||||||
|
|
||||||
private var cellView: TimelineTableCellView? {
|
private var cellView: TimelineTableCellView? {
|
||||||
for oneSubview in subviews {
|
for oneSubview in subviews {
|
||||||
if let foundView = oneSubview as? TimelineTableCellView {
|
if let foundView = oneSubview as? TimelineTableCellView {
|
||||||
|
@ -33,6 +21,9 @@ class TimelineTableRowView : NSTableRowView {
|
||||||
|
|
||||||
override var isEmphasized: Bool {
|
override var isEmphasized: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
|
if #available(macOS 10.14, *) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if let cellView = cellView {
|
if let cellView = cellView {
|
||||||
cellView.isEmphasized = isEmphasized
|
cellView.isEmphasized = isEmphasized
|
||||||
}
|
}
|
||||||
|
@ -41,40 +32,12 @@ class TimelineTableRowView : NSTableRowView {
|
||||||
|
|
||||||
override var isSelected: Bool {
|
override var isSelected: Bool {
|
||||||
didSet {
|
didSet {
|
||||||
|
if #available(macOS 10.14, *) {
|
||||||
|
return
|
||||||
|
}
|
||||||
if let cellView = cellView {
|
if let cellView = cellView {
|
||||||
cellView.isSelected = isSelected
|
cellView.isSelected = isSelected
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var gridRect: NSRect {
|
|
||||||
return NSMakeRect(0.0, NSMaxY(bounds) - 1.0, NSWidth(bounds), 1)
|
|
||||||
}
|
|
||||||
|
|
||||||
override func drawSeparator(in dirtyRect: NSRect) {
|
|
||||||
|
|
||||||
let path = NSBezierPath()
|
|
||||||
let originX = floor(cellAppearance.boxLeftMargin) + 2.0
|
|
||||||
let destinationX = ceil(NSMaxX(bounds))
|
|
||||||
let y = floor(NSMaxY(bounds)) - 0.5
|
|
||||||
path.move(to: NSPoint(x: originX, y: y))
|
|
||||||
path.line(to: NSPoint(x: destinationX, y: y))
|
|
||||||
|
|
||||||
cellAppearance.gridColor.set()
|
|
||||||
path.stroke()
|
|
||||||
}
|
|
||||||
|
|
||||||
override func draw(_ dirtyRect: NSRect) {
|
|
||||||
|
|
||||||
super.draw(dirtyRect)
|
|
||||||
|
|
||||||
if cellAppearance.drawsGrid && !isSelected && !isNextRowSelected {
|
|
||||||
drawSeparator(in: dirtyRect)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func invalidateGridRect() {
|
|
||||||
|
|
||||||
setNeedsDisplay(gridRect)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue