12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- //
- // KMNewUserGuideDisplayView.swift
- // PDF Reader Pro
- //
- // Created by User-Tangchao on 2024/12/21.
- //
- import Cocoa
- class KMNewUserGuideDisplayView: NSView {
- private lazy var iv_: NSImageView = {
- let view = NSImageView()
- return view
- }()
-
- var imageView: NSImageView {
- get {
- return iv_
- }
- }
-
- var contentInset: NSEdgeInsets = .init(top: 0, left: 0, bottom: 0, right: 0) {
- didSet {
- leftConst_?.constant = contentInset.left
- rightConst_?.constant = -contentInset.right
- topConst_?.constant = contentInset.top
- bottomConst_?.constant = -contentInset.bottom
- }
- }
-
- private var leftConst_: NSLayoutConstraint?
- private var topConst_: NSLayoutConstraint?
- private var rightConst_: NSLayoutConstraint?
- private var bottomConst_: NSLayoutConstraint?
-
- convenience init() {
- self.init(frame: .init(x: 0, y: 0, width: 200, height: 30))
-
- initSubViews()
- }
-
- override func awakeFromNib() {
- super.awakeFromNib()
-
- initSubViews()
- }
-
- func initSubViews() {
- addSubview(imageView)
- leftConst_ = imageView.km_add_leading_constraint_r()
- topConst_ = imageView.km_add_top_constraint_r()
- rightConst_ = imageView.km_add_trailing_constraint_r()
- bottomConst_ = imageView.km_add_bottom_constraint_r()
- }
- }
|