Remove customized layer with background color from TimelineTableCellView.

This commit is contained in:
Brent Simmons 2018-07-18 13:24:48 -07:00
parent b9e4212013
commit f736275c73
1 changed files with 21 additions and 21 deletions

View File

@ -48,13 +48,13 @@ class TimelineTableCellView: NSTableCellView {
return true
}
override var isOpaque: Bool {
return true
}
override var wantsUpdateLayer: Bool {
return true
}
// override var isOpaque: Bool {
// return true
// }
//
// override var wantsUpdateLayer: Bool {
// return true
// }
var isEmphasized = false {
didSet {
@ -122,20 +122,20 @@ class TimelineTableCellView: NSTableCellView {
starView.rs_setFrameIfNotEqual(layoutRects.starRect)
}
override func updateLayer() {
let color: NSColor
if isSelected {
color = isEmphasized ? NSColor.alternateSelectedControlColor : NSColor.secondarySelectedControlColor
}
else {
color = NSColor.white
}
if layer?.backgroundColor != color.cgColor {
layer?.backgroundColor = color.cgColor
}
}
// override func updateLayer() {
//
// let color: NSColor
// if isSelected {
// color = isEmphasized ? NSColor.alternateSelectedControlColor : NSColor.secondarySelectedControlColor
// }
// else {
// color = NSColor.white
// }
//
// if layer?.backgroundColor != color.cgColor {
// layer?.backgroundColor = color.cgColor
// }
// }
}
// MARK: - Private