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
@ -26,7 +26,11 @@ class TimelineTableCellView: NSTableCellView {
|
|||||||
override var isFlipped: Bool {
|
override var isFlipped: Bool {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override var isOpaque: Bool {
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
|
||||||
var isEmphasized = false {
|
var isEmphasized = false {
|
||||||
didSet {
|
didSet {
|
||||||
dateView.emphasized = isEmphasized
|
dateView.emphasized = isEmphasized
|
||||||
@ -40,6 +44,7 @@ class TimelineTableCellView: NSTableCellView {
|
|||||||
dateView.selected = isSelected
|
dateView.selected = isSelected
|
||||||
feedNameView.selected = isSelected
|
feedNameView.selected = isSelected
|
||||||
titleView.selected = isSelected
|
titleView.selected = isSelected
|
||||||
|
needsDisplay = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -107,7 +112,13 @@ class TimelineTableCellView: NSTableCellView {
|
|||||||
dateView.rs_setFrameIfNotEqual(layoutRects.dateRect)
|
dateView.rs_setFrameIfNotEqual(layoutRects.dateRect)
|
||||||
feedNameView.rs_setFrameIfNotEqual(layoutRects.feedNameRect)
|
feedNameView.rs_setFrameIfNotEqual(layoutRects.feedNameRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override func draw(_ dirtyRect: NSRect) {
|
||||||
|
|
||||||
|
isSelected ? NSColor.alternateSelectedControlColor.set() : NSColor.white.set()
|
||||||
|
dirtyRect.fill()
|
||||||
|
}
|
||||||
|
|
||||||
private func updateTitleView() {
|
private func updateTitleView() {
|
||||||
|
|
||||||
titleView.attributedStringValue = cellData.attributedTitle
|
titleView.attributedStringValue = cellData.attributedTitle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user