From 6d7b506c8a380e4dd97f337590ca079d810a360a Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Tue, 15 Sep 2026 13:46:50 -0300 Subject: Follow embedded PDF links through Look --- src/macos/Sources/PardesView.swift | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/macos/Sources/PardesView.swift') diff --git a/src/macos/Sources/PardesView.swift b/src/macos/Sources/PardesView.swift index bfc8a060..2160047d 100644 --- a/src/macos/Sources/PardesView.swift +++ b/src/macos/Sources/PardesView.swift @@ -809,6 +809,14 @@ final class PardesView: NSView { // whatever we do, so clipping would save fills and nothing else. Narrow // the row loops to the dirty band if that ever shows up in a profile. let count = pardes_frame() + let nextLinkPointer = pardes_pointer_shape() == 1 + if nextLinkPointer != linkPointer { + linkPointer = nextLinkPointer + window?.invalidateCursorRects(for: self) + if let window, bounds.contains(convert(window.mouseLocationOutsideOfEventStream, from: nil)) { + (linkPointer ? NSCursor.pointingHand : NSCursor.iBeam).set() + } + } let scene = pardes_scene() let trackCount = Int(pardes_frame_panel_tracks()) let tracks: UnsafeBufferPointer @@ -1967,10 +1975,12 @@ final class PardesView: NSView { userInfo: nil)) } + private var linkPointer = false + override func resetCursorRects() { // Every cell in this view is text, including the tags. An arrow over a // grid you can sweep and click words in is the wrong affordance. - addCursorRect(bounds, cursor: .iBeam) + addCursorRect(bounds, cursor: linkPointer ? .pointingHand : .iBeam) } override func setFrameSize(_ newSize: NSSize) { -- cgit v1.3