12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- //
- // KMBatchBackgroundView.swift
- // PDF Master
- //
- // Created by lizhe on 2023/1/16.
- //
- import Cocoa
- class KMBatchBackgroundView: KMBatchSettingItemView {
- @IBOutlet weak var applyButton: NSButton!
- @IBOutlet weak var itemContentView: NSView!
-
- override func setup() {
- super.setup()
-
- self.applyButton.wantsLayer = true
- self.applyButton.layer?.cornerRadius = 4
- self.applyButton.contentTintColor = NSColor.km_init(hex: "#FFFFFF")
- self.applyButton.stringValue = NSLocalizedString("Compress", comment: "")
- self.applyButton.font = NSFont.SFProTextRegularFont(14.0)
- self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#BDDFFD").cgColor
- }
-
- override func reloadData() {
-
- if (self.filesData.count != 0) {
- self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#1770F4").cgColor
- self.applyButton.isEnabled = true
- } else {
- self.applyButton.layer?.backgroundColor = NSColor.km_init(hex: "#BDDFFD").cgColor
- self.applyButton.isEnabled = false
- }
- }
- }
- protocol KMBatchBackgroundViewAction: KMBatchBackgroundView {}
- extension KMBatchBackgroundView: KMBatchBackgroundViewAction {
- @IBAction func applyButtonAction(_ sender: NSButton) {
- }
- }
|