Skip to content

Commit 364216b

Browse files
committed
feat: add open/closed hand cursor feedback to arrow control
Show open hand cursor on hover and closed hand while dragging, following Apple HIG guidelines for draggable controls. Closes #23
1 parent d73254a commit 364216b

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Timer/MVClockArrowView.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,12 @@ final class MVClockArrowView: NSView {
4343
path.fill()
4444
}
4545

46+
override func resetCursorRects() {
47+
self.addCursorRect(self.bounds, cursor: .openHand)
48+
}
49+
4650
override func mouseDown(with event: NSEvent) {
51+
NSCursor.closedHand.push()
4752
var isDragging = false
4853
var isTracking = true
4954
var trackingEvent: NSEvent = event
@@ -52,6 +57,7 @@ final class MVClockArrowView: NSView {
5257
switch trackingEvent.type {
5358
case .leftMouseUp:
5459
isTracking = false
60+
NSCursor.pop()
5561
self.handleUp()
5662

5763
case .leftMouseDragged:

0 commit comments

Comments
 (0)