color icon cursor
This commit is contained in:
@@ -476,6 +476,25 @@ private final class FlowTextView: NSTextView {
|
||||
return super.resignFirstResponder()
|
||||
}
|
||||
|
||||
override func cursorUpdate(with event: NSEvent) {
|
||||
guard frontmost(event) else {
|
||||
NSCursor.arrow.set()
|
||||
return
|
||||
}
|
||||
super.cursorUpdate(with: event)
|
||||
}
|
||||
|
||||
override func mouseMoved(with event: NSEvent) {
|
||||
guard frontmost(event) else {
|
||||
return
|
||||
}
|
||||
super.mouseMoved(with: event)
|
||||
}
|
||||
|
||||
private func frontmost(_ event: NSEvent) -> Bool {
|
||||
unsafe window?.contentView?.hitTest(event.locationInWindow)?.isDescendant(of: self) == true
|
||||
}
|
||||
|
||||
override func mouseDown(with event: NSEvent) {
|
||||
let onLink = link(at: convert(event.locationInWindow, from: nil))
|
||||
super.mouseDown(with: event)
|
||||
|
||||
Reference in New Issue
Block a user