KMBatchOperateCompressSettingViewController.swift 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. //
  2. // KMBatchOperateCompressSettingViewController.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by lizhe on 2024/11/15.
  6. //
  7. import Cocoa
  8. typealias KMBatchOperateCompressSettingViewCancelAction = (_ controller: KMBatchOperateCompressSettingViewController ) -> Void
  9. typealias KMBatchOperateCompressSettingViewDoneAction = (_ controller: KMBatchOperateCompressSettingViewController ) -> Void
  10. class KMBatchOperateCompressSettingViewController: KMBaseViewController {
  11. @IBOutlet weak var doneButton: KMButton!
  12. @IBOutlet weak var cancelButton: KMButton!
  13. @IBOutlet weak var settingView: KMCompressSettingTableView!
  14. var cancelAction: KMBatchOperateCompressSettingViewCancelAction?
  15. var doneAction: KMBatchOperateCompressSettingViewDoneAction?
  16. override func viewDidLoad() {
  17. super.viewDidLoad()
  18. // Do view setup here.
  19. // 将按钮设置为第一响应者
  20. if let window = view.window {
  21. window.makeFirstResponder(doneButton.nextResponder)
  22. window.defaultButtonCell = doneButton.cell as? NSButtonCell
  23. window.contentMinSize = CGSizeMake(624, 513)
  24. window.contentMaxSize = CGSizeMake(624, 513)
  25. }
  26. }
  27. }
  28. extension KMBatchOperateCompressSettingViewController {
  29. @IBAction func cancelButtonAction(_ sender: Any) {
  30. guard let callBack = cancelAction else { return }
  31. callBack(self)
  32. }
  33. @IBAction func doneButtonAction(_ sender: Any) {
  34. guard let callBack = doneAction else { return }
  35. callBack(self)
  36. }
  37. }