12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- //
- // KMPageEditBaseItemView.swift
- // PDF Reader Pro
- //
- // 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)
- }
- }
|