// // KMPageEditBaseItemView.swift // PDF Master // // Created by tangchao on 2023/1/11. // import Cocoa // 页面编辑 [视图] [基类] class KMPageEditBaseItemView: NSView { lazy var titleLabel: NSTextField = { let label = NSTextField(labelWithString: "") return label }() var contentInset = NSEdgeInsetsMake(8, 16, 0, 0) { didSet { self.layoutSubtreeIfNeeded() } } var itemClick: KMCommonClickBlock? override var isFlipped: Bool { return true } override init(frame frameRect: NSRect) { super.init(frame: frameRect) self.initSubviews() } required init?(coder: NSCoder) { super.init(coder: coder) self.initSubviews() } func initSubviews() { self.addSubview(self.titleLabel) } override func layout() { super.layout() self.titleLabel.frame = NSMakeRect(self.contentInset.left, self.contentInset.top, NSWidth(self.bounds)-self.contentInset.left-self.contentInset.right, 22) } }