2016-09-08 00:18:35 +03:00
|
|
|
/**
|
|
|
|
* Tae Won Ha - http://taewon.de - @hataewon
|
|
|
|
* See LICENSE
|
|
|
|
*/
|
|
|
|
|
|
|
|
import Cocoa
|
|
|
|
|
|
|
|
class OpenQuicklyFileViewRow: NSTableRowView {
|
|
|
|
|
2016-09-25 18:50:33 +03:00
|
|
|
override func drawSelection(in dirtyRect: NSRect) {
|
|
|
|
if self.isSelected {
|
|
|
|
NSColor.selectedControlColor.set()
|
2016-09-08 00:18:35 +03:00
|
|
|
} else {
|
2016-09-25 18:50:33 +03:00
|
|
|
NSColor.clear.set()
|
2016-09-08 00:18:35 +03:00
|
|
|
}
|
|
|
|
|
2016-09-25 18:50:33 +03:00
|
|
|
self.rectsBeingDrawn().forEach { NSRectFillUsingOperation(NSIntersectionRect($0, dirtyRect), .sourceOver) }
|
2016-09-08 00:18:35 +03:00
|
|
|
}
|
|
|
|
|
2016-09-25 18:50:33 +03:00
|
|
|
fileprivate func rectsBeingDrawn() -> [CGRect] {
|
|
|
|
var rectsPtr: UnsafePointer<CGRect>? = nil
|
2016-09-08 00:18:35 +03:00
|
|
|
var count: Int = 0
|
|
|
|
self.getRectsBeingDrawn(&rectsPtr, count: &count)
|
|
|
|
|
|
|
|
return Array(UnsafeBufferPointer(start: rectsPtr, count: count))
|
|
|
|
}
|
|
|
|
}
|