From 5384671bdc010a2a89f1534ba1d4a6d449487dea Mon Sep 17 00:00:00 2001 From: Ali Karbassi Date: Sat, 7 Feb 2026 03:12:11 -0600 Subject: [PATCH 1/2] feat: add scroll wheel input and improve label contrast Add scroll wheel and trackpad gesture support for setting the timer. Change minutes and seconds label colors to black for better readability. Closes #115 --- .../minutes-color.colorset/Contents.json | 12 ++++----- .../seconds-color.colorset/Contents.json | 12 ++++----- Timer/MVClockView+Behavior.swift | 25 +++++++++++++++++++ Timer/MVClockView.swift | 7 +++--- 4 files changed, 40 insertions(+), 16 deletions(-) diff --git a/Timer/Assets.xcassets/minutes-color.colorset/Contents.json b/Timer/Assets.xcassets/minutes-color.colorset/Contents.json index 220ba29..784f603 100644 --- a/Timer/Assets.xcassets/minutes-color.colorset/Contents.json +++ b/Timer/Assets.xcassets/minutes-color.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.271", - "green" : "0.255", - "red" : "0.235" + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.882", - "green" : "0.871", - "red" : "0.851" + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" } }, "idiom" : "universal" diff --git a/Timer/Assets.xcassets/seconds-color.colorset/Contents.json b/Timer/Assets.xcassets/seconds-color.colorset/Contents.json index 5cdfaa0..784f603 100644 --- a/Timer/Assets.xcassets/seconds-color.colorset/Contents.json +++ b/Timer/Assets.xcassets/seconds-color.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.686", - "green" : "0.667", - "red" : "0.635" + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.584", - "green" : "0.569", - "red" : "0.549" + "blue" : "0.000", + "green" : "0.000", + "red" : "0.000" } }, "idiom" : "universal" diff --git a/Timer/MVClockView+Behavior.swift b/Timer/MVClockView+Behavior.swift index be0ed4c..6e2f8a5 100644 --- a/Timer/MVClockView+Behavior.swift +++ b/Timer/MVClockView+Behavior.swift @@ -16,6 +16,31 @@ extension MVClockView { } } + override func scrollWheel(with event: NSEvent) { + guard self.timerTask == nil, !self.paused else { return } + + let delta: CGFloat + if event.hasPreciseScrollingDeltas { + delta = event.scrollingDeltaY * 3 + } else { + delta = event.scrollingDeltaY * 30 + } + + guard delta != 0 else { return } + + var newSeconds = self.seconds + delta + newSeconds = max(0, newSeconds) + + if newSeconds <= 300 { + newSeconds -= newSeconds.truncatingRemainder(dividingBy: 10) + } else { + newSeconds -= newSeconds.truncatingRemainder(dividingBy: 60) + } + + self.seconds = newSeconds + self.updateTimerTime() + } + override func mouseUp(with event: NSEvent) { let point = self.convert(event.locationInWindow, from: nil) if self.hitTest(point) == self, !self.didDrag { diff --git a/Timer/MVClockView.swift b/Timer/MVClockView.swift index 3c8773c..106c25c 100644 --- a/Timer/MVClockView.swift +++ b/Timer/MVClockView.swift @@ -213,7 +213,8 @@ extension MVClockView { } func handleClick() { - if self.timerTask == nil, self.seconds > 0 { + guard self.seconds > 0 else { return } + if self.timerTask == nil { self.updateTimerTime() self.start() } else { @@ -293,14 +294,12 @@ extension MVClockView { } } - private static let clockFaceHitPath = NSBezierPath(ovalIn: NSRect(x: 21, y: 21, width: 108, height: 108)) - override func hitTest(_ aPoint: NSPoint) -> NSView? { let view = super.hitTest(aPoint) if view == self.arrowView { return view } - if Self.clockFaceHitPath.contains(aPoint), self.seconds > 0 { + if view != nil { return self } return nil From c4744b043647d0ff6c60367da33df58985a9928a Mon Sep 17 00:00:00 2001 From: Ali Karbassi Date: Sat, 7 Feb 2026 03:16:53 -0600 Subject: [PATCH 2/2] fix: use Apple Lead (#191919) for label colors instead of pure black --- .../minutes-color.colorset/Contents.json | 12 ++++++------ .../seconds-color.colorset/Contents.json | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Timer/Assets.xcassets/minutes-color.colorset/Contents.json b/Timer/Assets.xcassets/minutes-color.colorset/Contents.json index 784f603..b4a20cc 100644 --- a/Timer/Assets.xcassets/minutes-color.colorset/Contents.json +++ b/Timer/Assets.xcassets/minutes-color.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.000", - "green" : "0.000", - "red" : "0.000" + "blue" : "0.098", + "green" : "0.098", + "red" : "0.098" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.000", - "green" : "0.000", - "red" : "0.000" + "blue" : "0.098", + "green" : "0.098", + "red" : "0.098" } }, "idiom" : "universal" diff --git a/Timer/Assets.xcassets/seconds-color.colorset/Contents.json b/Timer/Assets.xcassets/seconds-color.colorset/Contents.json index 784f603..b4a20cc 100644 --- a/Timer/Assets.xcassets/seconds-color.colorset/Contents.json +++ b/Timer/Assets.xcassets/seconds-color.colorset/Contents.json @@ -5,9 +5,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.000", - "green" : "0.000", - "red" : "0.000" + "blue" : "0.098", + "green" : "0.098", + "red" : "0.098" } }, "idiom" : "universal" @@ -23,9 +23,9 @@ "color-space" : "srgb", "components" : { "alpha" : "1.000", - "blue" : "0.000", - "green" : "0.000", - "red" : "0.000" + "blue" : "0.098", + "green" : "0.098", + "red" : "0.098" } }, "idiom" : "universal"