12345678910111213141516171819202122232425262728293031323334353637383940 |
- //
- // KMToolbarItemPopViewController.swift
- // PDF Reader Pro
- //
- // Created by liujiajie on 2023/11/10.
- //
- import Cocoa
- class KMToolbarItemPopViewController: NSViewController{
- @IBOutlet var toolbarHelpTipLabel: NSTextField!
-
- @IBOutlet weak var topConst: NSLayoutConstraint!
- @IBOutlet weak var leftConst: NSLayoutConstraint!
- @IBOutlet weak var rightConst: NSLayoutConstraint!
- @IBOutlet weak var bottomConst: NSLayoutConstraint!
-
- var contentInset: NSEdgeInsets = .init(top: 5, left: 5, bottom: 5, right: 5) {
- didSet {
- topConst.constant = contentInset.top
- leftConst.constant = contentInset.left
- rightConst.constant = contentInset.right
- bottomConst.constant = contentInset.bottom
- }
- }
-
- convenience init() {
- self.init(nibName: "KMToolbarItemPopViewController", bundle: nil)
-
- }
-
- @objc func updateWithHelpTip(helpTip: String) {
- self.toolbarHelpTipLabel.stringValue = helpTip.count > 0 ? helpTip : ""
- }
-
- override func viewDidLoad() {
- super.viewDidLoad()
- self.toolbarHelpTipLabel?.textColor = .labelColor
- }
- }
|