From 2b7b940b6d556a407482c834f12cd0eef8390286 Mon Sep 17 00:00:00 2001 From: Ian Gulliver Date: Sun, 18 Oct 2026 21:28:07 -0700 Subject: [PATCH] color icon cursor --- mac/Sources/Byre/MarkdownView.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/mac/Sources/Byre/MarkdownView.swift b/mac/Sources/Byre/MarkdownView.swift index 8941654..5ce5fa6 100644 --- a/mac/Sources/Byre/MarkdownView.swift +++ b/mac/Sources/Byre/MarkdownView.swift @@ -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)