KMToolbarItemPopViewController.swift 779 B

123456789101112131415161718192021222324252627282930
  1. //
  2. // KMToolbarItemPopViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by liujiajie on 2023/11/10.
  6. //
  7. import Cocoa
  8. class KMToolbarItemPopViewController: NSViewController{
  9. @IBOutlet var toolbarHelpTipLabel: NSTextField!
  10. convenience init() {
  11. self.init(nibName: "KMToolbarItemPopViewController", bundle: nil)
  12. }
  13. @objc func updateWithHelpTip(helpTip: String) {
  14. self.toolbarHelpTipLabel.stringValue = helpTip.count > 0 ? helpTip : ""
  15. }
  16. override func viewDidLoad() {
  17. super.viewDidLoad()
  18. self.view.wantsLayer = true
  19. self.view.layer?.backgroundColor = NSColor(hex: "#000000").withAlphaComponent(0.9).cgColor
  20. self.toolbarHelpTipLabel.textColor = .labelColor
  21. }
  22. }