diff options
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) { |
