1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- //
- // KMThumbnailTableviewCell.swift
- // PDF Master
- //
- // Created by tangchao on 2023/11/16.
- //
- import Cocoa
- class KMThumbnailTableviewCell: NSTableCellView {
- @IBOutlet var thumBox: KMBox!
- @IBOutlet var thumImage: NSImageView!
- @IBOutlet var pageNumLabel: NSTextField!
- @IBOutlet var sizeLabel: NSTextField!
- @IBOutlet var labelView: NSView!
- @IBOutlet var sizeTopConstant: NSLayoutConstraint!
- @IBOutlet var imageAspectRatioLayout: NSLayoutConstraint!
-
- var isSelectCell = false {
- didSet {
- if (self.isSelectCell) {
- self.thumImage.layer?.borderColor = KMAppearance.Interactive.a0Color().cgColor
- self.thumImage.layer?.borderWidth = 1.0
- self.labelView.layer?.backgroundColor = KMAppearance.Interactive.a0Color().cgColor
- self.pageNumLabel.textColor = KMAppearance.Layout.w0Color()
- self.sizeLabel.textColor = KMAppearance.Layout.w0Color()
- } else {
- self.thumImage.layer?.borderColor = KMAppearance.Layout.h2Color().cgColor
- self.thumImage.layer?.borderWidth = 1.0
- self.labelView.layer?.backgroundColor = .clear
- self.pageNumLabel.textColor = KMAppearance.Layout.h0Color()
- self.sizeLabel.textColor = KMAppearance.Layout.h0Color()
- }
- }
- }
-
- override func awakeFromNib() {
- super.awakeFromNib()
-
- self.wantsLayer = true
- self.layer?.backgroundColor = .clear
- self.layer?.cornerRadius = 0.0
-
- self.thumImage.wantsLayer = true
- self.labelView.wantsLayer = true
- }
- }
|