// // KMNBotaSearchCellView.swift // PDF Reader Pro // // Created by User-Tangchao on 2024/12/2. // import Cocoa class KMNBotaSearchCellView: NSTableCellView { private lazy var label_: NSTextField = { let view = NSTextField(wrappingLabelWithString: "") return view }() var label: NSTextField { get { return label_ } } convenience init() { self.init(frame: .init(x: 0, y: 0, width: 200, height: 40)) addSubview(label_) } override func layout() { super.layout() let x: CGFloat = 24 let y: CGFloat = 8 let w = max(NSWidth(self.frame)-x*2, 0) let h = max(NSHeight(self.frame)-y*2, 0) label.frame = NSMakeRect(x, y, w, h) } }