diff --git a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift index ea4dcadee..01f96f512 100644 --- a/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift +++ b/Mac/MainWindow/Timeline/Cell/TimelineTableCellView.swift @@ -48,6 +48,18 @@ class TimelineTableCellView: NSTableCellView { } } + var isEmphasized: Bool = false { + didSet { + unreadIndicatorView.isEmphasized = isEmphasized + } + } + + var isSelected: Bool = false { + didSet { + unreadIndicatorView.isSelected = isSelected + } + } + override var isFlipped: Bool { return true } diff --git a/Mac/MainWindow/Timeline/Cell/UnreadIndicatorView.swift b/Mac/MainWindow/Timeline/Cell/UnreadIndicatorView.swift index cc61dcb5b..d3b4d7c00 100644 --- a/Mac/MainWindow/Timeline/Cell/UnreadIndicatorView.swift +++ b/Mac/MainWindow/Timeline/Cell/UnreadIndicatorView.swift @@ -12,13 +12,33 @@ class UnreadIndicatorView: NSView { static let unreadCircleDimension: CGFloat = 8.0 + var isEmphasized = false { + didSet { + if isEmphasized != oldValue { + needsDisplay = true + } + } + } + + var isSelected = false { + didSet { + if isSelected != oldValue { + needsDisplay = true + } + } + } + static let bezierPath: NSBezierPath = { let r = NSRect(x: 0.0, y: 0.0, width: unreadCircleDimension, height: unreadCircleDimension) return NSBezierPath(ovalIn: r) }() override func draw(_ dirtyRect: NSRect) { - NSColor.controlAccentColor.setFill() + if isSelected && isEmphasized { + NSColor.white.setFill() + } else { + NSColor.controlAccentColor.setFill() + } UnreadIndicatorView.bezierPath.fill() } diff --git a/Mac/MainWindow/Timeline/TimelineTableRowView.swift b/Mac/MainWindow/Timeline/TimelineTableRowView.swift index 162fb0681..aafd39689 100644 --- a/Mac/MainWindow/Timeline/TimelineTableRowView.swift +++ b/Mac/MainWindow/Timeline/TimelineTableRowView.swift @@ -14,6 +14,18 @@ class TimelineTableRowView : NSTableRowView { return true } + override var isEmphasized: Bool { + didSet { + cellView?.isEmphasized = isEmphasized + } + } + + override var isSelected: Bool { + didSet { + cellView?.isSelected = isSelected + } + } + init() { super.init(frame: NSRect.zero) }