KMLinkAnnotationPropertyEmptyController.swift 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. 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.emptyImageView.image = NSImage(named: "KMImageNameEmptyLink")
  31. }
  32. override func initLocalization() {
  33. super.initLocalization()
  34. self.emptyLabel.stringValue = NSLocalizedString("Select an area or text on a page for a link to be inserted.", comment: "")
  35. }
  36. }