KMBatchoperateConvertCollectionViewItem.swift 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  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 !KMMemberInfo.shared.isPermitConvert {
  43. KMMemberInfo.shared.advancedFunctionUsage()
  44. }
  45. }
  46. }