KMBookMarkRowView.swift 805 B

123456789101112131415161718192021222324252627282930313233343536
  1. //
  2. // KMBookMarkRowView.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by Niehaoyu on 2023/2/28.
  6. //
  7. import Cocoa
  8. class KMBookMarkRowView: NSTableRowView {
  9. var selectionColor : NSColor!
  10. override func draw(_ dirtyRect: NSRect) {
  11. super.draw(dirtyRect)
  12. // Drawing code here.
  13. self.wantsLayer = true
  14. }
  15. override func drawSelection(in dirtyRect: NSRect) {
  16. if self.selectionHighlightStyle == NSTableView.SelectionHighlightStyle.none {
  17. super.drawSelection(in: dirtyRect)
  18. } else {
  19. if(self.selectionColor != nil) {
  20. self.selectionColor.setFill()
  21. __NSRectFill(dirtyRect)
  22. } else {
  23. super.drawSelection(in: dirtyRect)
  24. }
  25. }
  26. }
  27. }