KMLinkAnnotationPropertyEmptyController.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. //
  2. // KMLinkAnnotationPropertyEmptyController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/4/23.
  6. //
  7. import Cocoa
  8. // Link 注释 [属性面板] [空状态]
  9. class KMLinkAnnotationPropertyEmptyController: KMRightSideEmptyVC {
  10. private lazy var titleLabel: NSTextField = {
  11. let label = NSTextField(labelWithString: "")
  12. return label
  13. }()
  14. deinit {
  15. NotificationCenter.default.removeObserver(self)
  16. KMPrint("\(self.className) deinit.")
  17. }
  18. convenience init() {
  19. self.init(nibName: "KMRightSideEmptyVC", bundle: nil)
  20. }
  21. override func viewDidLoad() {
  22. super.viewDidLoad()
  23. // Do view setup here.
  24. }
  25. override func updateUI() {
  26. super.updateUI()
  27. self.view.addSubview(self.titleLabel)
  28. let titleLabelX: CGFloat = 8
  29. let titleLabelH: CGFloat = 20
  30. let titleLabelY: CGFloat = 12
  31. self.titleLabel.frame = NSMakeRect(titleLabelX, NSHeight(self.view.bounds)-titleLabelH-titleLabelY, NSWidth(self.view.bounds)-titleLabelX, titleLabelH)
  32. self.titleLabel.autoresizingMask = [.width, .minYMargin]
  33. self.titleLabel.stringValue = NSLocalizedString("Link", comment: "")
  34. self.emptyImageView.image = NSImage(named: "KMImageNameEmptyLink")
  35. }
  36. override func initLocalization() {
  37. super.initLocalization()
  38. self.emptyLabel.stringValue = NSLocalizedString("Select an area or text on a page for a link to be inserted.", comment: "")
  39. }
  40. }