// // KMSeparatorCell.swift // PDF Reader Pro // // Created by lizhe on 2024/2/21. // import Cocoa let SEPARATOR_LEFT_INDENT = 4.0 let SEPARATOR_RIGHT_INDENT = 2.0 class KMSeparatorCell: NSCell { override func draw(withFrame cellFrame: NSRect, in controlView: NSView) { NSGraphicsContext.saveGraphicsState() NSColor.gridColor.setStroke() NSBezierPath.defaultLineWidth = 1.0 NSBezierPath.strokeLine(from: NSPoint(x: cellFrame.minX + SEPARATOR_LEFT_INDENT, y: floor(cellFrame.midY) + 0.5), to: NSPoint(x: cellFrame.maxX - SEPARATOR_RIGHT_INDENT, y: floor(cellFrame.midY) + 0.5)) NSGraphicsContext.restoreGraphicsState() } }