KMLinkAnnotationPropertyEmptyController.swift 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // KMLinkAnnotationPropertyEmptyController.swift
  3. // PDF Master
  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. convenience init() {
  15. self.init(nibName: "KMRightSideEmptyVC", bundle: nil)
  16. }
  17. override func viewDidLoad() {
  18. super.viewDidLoad()
  19. // Do view setup here.
  20. }
  21. override func updateUI() {
  22. super.updateUI()
  23. self.view.addSubview(self.titleLabel)
  24. let titleLabelX: CGFloat = 8
  25. let titleLabelH: CGFloat = 20
  26. let titleLabelY: CGFloat = 12
  27. self.titleLabel.frame = NSMakeRect(titleLabelX, NSHeight(self.view.bounds)-titleLabelH-titleLabelY, NSWidth(self.view.bounds)-titleLabelX, titleLabelH)
  28. self.titleLabel.autoresizingMask = [.width, .minYMargin]
  29. self.titleLabel.stringValue = NSLocalizedString("Link", comment: "")
  30. self.titleLabel.font = NSFont.SFProTextSemiboldFont(14)
  31. self.titleLabel.textColor = NSColor.km_init(hex: "#252629")
  32. self.emptyImageView.image = NSImage(named: "KMImageNamePropertyLinkEmpty")
  33. }
  34. override func initLocalization() {
  35. super.initLocalization()
  36. self.emptyLabel.stringValue = NSLocalizedString("Select an area or text on a page to add a link", comment: "")
  37. }
  38. }