Draw a background color for the timeline cell, and make it opaque, so it looks not-weird when dragging.
This commit is contained in:
parent
9f56030b79
commit
861afa06c7
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue