// // KMBookMarkRowView.swift // PDF Reader Pro // // Created by Niehaoyu on 2023/2/28. // import Cocoa class KMBookMarkRowView: NSTableRowView { var selectionColor : NSColor! override func draw(_ dirtyRect: NSRect) { super.draw(dirtyRect) // Drawing code here. self.wantsLayer = true } override func drawSelection(in dirtyRect: NSRect) { if self.selectionHighlightStyle == NSTableView.SelectionHighlightStyle.none { super.drawSelection(in: dirtyRect) } else { if(self.selectionColor != nil) { self.selectionColor.setFill() __NSRectFill(dirtyRect) } else { super.drawSelection(in: dirtyRect) } } } }