diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-15 13:46:50 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-09-15 17:24:42 -0300 |
| commit | 6d7b506c8a380e4dd97f337590ca079d810a360a (patch) | |
| tree | 71075c8c4383df25c6ecd5140ef75063a897b444 /src/macos/Sources/PardesView.swift | |
| parent | 13d0d107a06d7ac5fb5f8e86c747e54603f51b4e (diff) | |
| download | pardes-6d7b506c8a380e4dd97f337590ca079d810a360a.tar.gz pardes-6d7b506c8a380e4dd97f337590ca079d810a360a.zip | |
Follow embedded PDF links through Look
Diffstat (limited to 'src/macos/Sources/PardesView.swift')
| -rw-r--r-- | src/macos/Sources/PardesView.swift | 12 |
1 files changed, 11 insertions, 1 deletions
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<pardes_panel_track_s> @@ -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) { |
