KMNAPPExpirationWindowController.swift 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. //
  2. // KMNAPPExpirationWindowController.swift
  3. // PDF Reader Pro Beta
  4. //
  5. // Created by kdanmobile on 2025/3/1.
  6. //
  7. import Cocoa
  8. import KMComponentLibrary
  9. class KMNAPPExpirationWindowController: KMNBaseWindowController {
  10. @IBOutlet var titleLabel: NSTextField!
  11. @IBOutlet var subTitleLabel: NSTextField!
  12. @IBOutlet var subContentLabel: NSTextField!
  13. @IBOutlet var sureButton: ComponentButton!
  14. @IBOutlet var contentTopConstraint:NSLayoutConstraint!
  15. var isEndTime: Bool! {
  16. get {
  17. //需拿远端的控制的时间
  18. return true
  19. }
  20. }
  21. override func windowDidLoad() {
  22. super.windowDidLoad()
  23. }
  24. override func initContentView() {
  25. titleLabel.font = NSFont.boldSystemFont(ofSize: 24)
  26. subTitleLabel.font = ComponentLibrary.shared.getFontFromKey ("mac/body-m-medium")
  27. subContentLabel.font = ComponentLibrary.shared.getFontFromKey("mac/body-m-medium")
  28. sureButton.properties = ComponentButtonProperty(type: .primary,
  29. size: .s,
  30. state: .normal,
  31. buttonText: KMLocalizedString("I Know"))
  32. sureButton.setTarget(self, action: #selector(submitButtonClicked(_ :)))
  33. sureButton.keyEquivalent = KMKeyEquivalent.enter
  34. if(isEndTime) {
  35. contentTopConstraint.constant = 70
  36. subContentLabel.isHidden = false
  37. } else {
  38. contentTopConstraint.constant = 46
  39. subContentLabel.isHidden = true
  40. }
  41. }
  42. override func updateUIThemeColor() {
  43. window?.contentView?.wantsLayer = true
  44. window?.contentView?.layer?.backgroundColor = ComponentLibrary.shared.getComponentColorFromKey("colorBg/popup").cgColor
  45. titleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorError/base")
  46. subTitleLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey ("colorText/1")
  47. subContentLabel.textColor = ComponentLibrary.shared.getComponentColorFromKey("colorText/1")
  48. sureButton.reloadData()
  49. }
  50. override func updateUILanguage() {
  51. titleLabel.stringValue = KMLocalizedString("Beta's Usage Rights Has Expired")
  52. subTitleLabel.stringValue = KMLocalizedString("PDF Reader Pro Team has incorporated your suggestions into consideration. ")
  53. subContentLabel.stringValue = KMLocalizedString("Please stay tuned for PDF Reader Pro 2025!")
  54. sureButton.properties.buttonText = KMLocalizedString("I Know")
  55. sureButton.reloadData()
  56. }
  57. //MARK: - Action
  58. @objc func cancelButtonClicked(_ sender: NSView) {
  59. own_closeEndSheet()
  60. }
  61. @objc func submitButtonClicked(_ sender: NSView) {
  62. own_closeEndSheet()
  63. }
  64. }