KMUnbindAlertViewController.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. //
  2. // KMUnbindAlertViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 2024/8/7.
  6. //
  7. import Cocoa
  8. @objc class KMUnbindAlertViewController: NSViewController {
  9. @IBOutlet var contendView: NSView!
  10. @IBOutlet var titleLabel: NSTextField!
  11. @IBOutlet var contactButton: KMCustomButton!
  12. override func viewDidLoad() {
  13. super.viewDidLoad()
  14. // Do view setup here.
  15. self.contendView.wantsLayer = true
  16. self.contactButton.wantsLayer = true
  17. self.contactButton.layer?.masksToBounds = true
  18. self.contactButton.layer?.cornerRadius = 1
  19. self.contactButton.title = NSLocalizedString("Contact Support", comment: "")
  20. self.contactButton.setTitleColor(KMAppearance.Layout.h0Color())
  21. self.titleLabel.font = NSFont.SFProTextRegularFont(16)
  22. self.updateViewColor()
  23. }
  24. @objc func updateViewColor() {
  25. if KMAppearance.isDarkMode() {
  26. self.contendView.layer?.backgroundColor = NSColor(red: 33/255, green: 33/255, blue: 33/255, alpha: 1).cgColor
  27. self.titleLabel.textColor = NSColor.white
  28. self.contactButton.layer?.backgroundColor = NSColor(red: 78/255, green: 127/255, blue: 219/255, alpha: 1).cgColor
  29. } else {
  30. self.contendView.layer?.backgroundColor = NSColor.white.cgColor
  31. self.titleLabel.textColor = NSColor.black
  32. self.contactButton.layer?.backgroundColor = NSColor(red: 39/255, green: 60/255, blue: 98/255, alpha: 1).cgColor
  33. }
  34. }
  35. //MARK: - IBAction
  36. @IBAction func contactAction(_ sender: KMCustomButton) {
  37. }
  38. }