Draw a background color for the timeline cell, and make it opaque, so it looks not-weird when dragging.

This commit is contained in:
Brent Simmons 2017-11-11 21:53:43 -08:00
parent 9f56030b79
commit 861afa06c7
1 changed files with 13 additions and 2 deletions

View File

@ -27,6 +27,10 @@ class TimelineTableCellView: NSTableCellView {
return true
}
override var isOpaque: Bool {
return true
}
var isEmphasized = false {
didSet {
dateView.emphasized = isEmphasized
@ -40,6 +44,7 @@ class TimelineTableCellView: NSTableCellView {
dateView.selected = isSelected
feedNameView.selected = isSelected
titleView.selected = isSelected
needsDisplay = true
}
}
@ -108,6 +113,12 @@ class TimelineTableCellView: NSTableCellView {
feedNameView.rs_setFrameIfNotEqual(layoutRects.feedNameRect)
}
override func draw(_ dirtyRect: NSRect) {
isSelected ? NSColor.alternateSelectedControlColor.set() : NSColor.white.set()
dirtyRect.fill()
}
private func updateTitleView() {
titleView.attributedStringValue = cellData.attributedTitle