KMBatchBatesNumberView.swift 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //
  2. // KMBatchBatesNumberView.swift
  3. // PDF Master
  4. //
  5. // Created by lizhe on 2023/1/16.
  6. //
  7. import Cocoa
  8. class KMBatchBatesNumberView: KMBatchSettingItemView {
  9. @IBOutlet weak var itemContentView: NSView!
  10. @IBOutlet weak var applyButton: NSButton!
  11. override func draw(_ dirtyRect: NSRect) {
  12. super.draw(dirtyRect)
  13. // Drawing code here.
  14. }
  15. override func setup() {
  16. super.setup()
  17. self.applyButton.wantsLayer = true
  18. self.applyButton.layer?.cornerRadius = 4
  19. self.applyButton.contentTintColor = NSColor.km_init(hex: "#FFFFFF")
  20. self.applyButton.stringValue = NSLocalizedString("Apply", comment: "")
  21. self.applyButton.font = NSFont.SFProTextRegularFont(14.0)
  22. self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#BDDFFD").cgColor
  23. }
  24. override func reloadData() {
  25. if (self.filesData.count != 0) {
  26. self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#1770F4").cgColor
  27. self.applyButton.isEnabled = true
  28. } else {
  29. self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#BDDFFD").cgColor
  30. self.applyButton.isEnabled = false
  31. }
  32. }
  33. }
  34. protocol KMBatchBatesNumberViewAction: KMBatchBatesNumberView {}
  35. extension KMBatchBatesNumberView: KMBatchBatesNumberViewAction {
  36. @IBAction func applyButtonAction(_ sender: NSButton) {
  37. }
  38. }