KMBatchoperateConvertCollectionViewItem.swift 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // KMBatchoperateConvertCollectionViewItem.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by kdanmobile on 2023/11/1.
  6. //
  7. import Cocoa
  8. class KMBatchoperateConvertCollectionViewItem: NSCollectionViewItem{
  9. var selectLayer: CALayer?
  10. @IBOutlet var advancedButton: NSButton!
  11. @IBOutlet var containerView: NSView!
  12. @IBOutlet var moreInfoTextField: NSTextField!
  13. @IBOutlet var icomIV: NSImageView!
  14. @IBOutlet var nameTF: NSTextField!
  15. override func viewDidLoad() {
  16. super.viewDidLoad()
  17. self.nameTF!.font = NSFont.systemFont(ofSize: 12)
  18. nameTF!.textColor = KMAppearance.Layout.h1Color()
  19. moreInfoTextField.font = NSFont.boldSystemFont(ofSize: 9)
  20. moreInfoTextField.textColor = KMAppearance.Layout.mColor()
  21. view.wantsLayer = true
  22. selectLayer = CALayer()
  23. view.layer?.addSublayer(selectLayer!)
  24. selectLayer?.frame = CGRect(x: 0, y: 0, width: 64, height: 76)
  25. selectLayer!.backgroundColor = KMAppearance.Status.selColor().cgColor
  26. selectLayer?.cornerRadius = 6
  27. selectLayer!.isHidden = true
  28. moreInfoTextField.sizeToFit()
  29. containerView.wantsLayer = true
  30. containerView.layer?.cornerRadius = moreInfoTextField.bounds.height / 2
  31. }
  32. override var isSelected: Bool{
  33. get{
  34. return super.isSelected
  35. }
  36. set{
  37. super.isSelected = newValue
  38. self.selectLayer?.isHidden = !newValue
  39. }
  40. }
  41. @IBAction func buttonClicked_AdvancedClicked(_ sender: Any) {
  42. // if !IAPProductsManager.default().isAvailableAdvancedPDFToOffice() {
  43. // KMProductCompareWC.shared.orientation = false
  44. // KMProductCompareWC.shared.showWindow(nil)
  45. // }
  46. if !KMMemberInfo.shared.isPermitConvert {
  47. KMMemberInfo.shared.advancedFunctionUsage()
  48. }
  49. }
  50. }