KMOutlineView.swift 912 B

1234567891011121314151617181920212223242526272829303132
  1. //
  2. // KMOutlineView.swift
  3. // PDF Reader Pro
  4. //
  5. // Created by lxy on 2022/10/18.
  6. //
  7. import Cocoa
  8. enum KMOutlineViewExpandItemType: Int {
  9. case none
  10. case expand
  11. case collapse
  12. }
  13. class KMOutlineView: KMTocOutlineView {
  14. override func makeView(withIdentifier identifier: NSUserInterfaceItemIdentifier, owner: Any?) -> NSView? {
  15. let view = super.makeView(withIdentifier: identifier, owner: owner)
  16. if identifier == NSOutlineView.disclosureButtonIdentifier {
  17. (view as! NSButton).image = NSImage(named: "btn_arrow_gray_right_s_norm_on")
  18. (view as! NSButton).alternateImage = NSImage(named: "btn_arrow_gray_down_s_norm_on")
  19. (view as! NSButton).isBordered = false
  20. (view as! NSButton).title = ""
  21. }
  22. return view
  23. }
  24. override func frameOfOutlineCell(atRow row: Int) -> NSRect {
  25. return NSZeroRect
  26. }
  27. }