KMBotaTableRowView.swift 902 B

12345678910111213141516171819202122232425262728293031323334
  1. //
  2. // KMBotaTableRowView.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by tangchao on 2023/11/28.
  6. //
  7. import Cocoa
  8. class KMBotaTableRowView: NSTableRowView {
  9. convenience init() {
  10. self.init(frame: .zero)
  11. self.addTrackingArea()
  12. }
  13. override func draw(_ dirtyRect: NSRect) {
  14. super.draw(dirtyRect)
  15. // Drawing code here.
  16. }
  17. func addTrackingArea() {
  18. let trackingArea = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .inVisibleRect, .activeAlways, .mouseMoved], owner: self, userInfo: nil)
  19. self.addTrackingArea(trackingArea)
  20. }
  21. override func drawSelection(in dirtyRect: NSRect) {
  22. let selectionRect = self.bounds
  23. KMAppearance.Status.selColor().setFill()
  24. let selectionPath = NSBezierPath(roundedRect: selectionRect, xRadius: 0, yRadius: 0)
  25. selectionRect.fill()
  26. }
  27. }