Skip to content

Commit 9eaf8e4

Browse files
committed
fix: tint icons via colorMultiply so status colors render
NotchyIcon's shapes draw with `ctx.stroke(..., with: .color(.primary))` inside Canvas closures. Canvas does not inherit `.foregroundStyle(...)` from its parent, so the green/orange status colors set on the notch pill and tab status indicator silently resolved to the chrome's .primary (white) and the icons looked monochrome. Add an explicit `tint: Color` parameter on NotchyIcon (defaults to white, matching the previous .primary behaviour in dark chrome) and multiply the rendered output by it via `.colorMultiply`. Update the notch pill and tab bar call sites to pass `tint: DS.Color.statusXxx` instead of `.foregroundStyle(...)`.
1 parent c701967 commit 9eaf8e4

3 files changed

Lines changed: 12 additions & 12 deletions

File tree

Notchy/Icons.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,16 @@ struct NotchyIcon: View {
2626
let kind: NotchyIconKind
2727
var size: CGFloat = 14
2828
var weight: CGFloat = 1.5
29+
/// Tint applied to the rendered Canvas output. Canvas drawing uses
30+
/// `.color(.primary)` internally and does NOT inherit
31+
/// `.foregroundStyle(...)` from the parent view, so we multiply the
32+
/// rendered (white) pixels by `tint` here. Default white = no change.
33+
var tint: Color = .white
2934

3035
var body: some View {
3136
shape
3237
.frame(width: size, height: size)
38+
.colorMultiply(tint)
3339
}
3440

3541
// Split into helpers so the Swift type-checker can resolve each branch

Notchy/NotchWindow.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -630,16 +630,13 @@ struct NotchPillContent: View {
630630

631631
switch displayState {
632632
case .taskCompleted:
633-
NotchyIcon(kind: .done, size: 16)
634-
.foregroundStyle(DS.Color.statusDone)
633+
NotchyIcon(kind: .done, size: 16, tint: DS.Color.statusDone)
635634
.transition(.scale.combined(with: .opacity))
636635
case .waitingForInput:
637-
NotchyIcon(kind: .waiting, size: 16)
638-
.foregroundStyle(DS.Color.statusWaiting)
636+
NotchyIcon(kind: .waiting, size: 16, tint: DS.Color.statusWaiting)
639637
.transition(.scale.combined(with: .opacity))
640638
case .working:
641-
NotchyIcon(kind: .working, size: 14)
642-
.foregroundStyle(DS.Color.statusWorking)
639+
NotchyIcon(kind: .working, size: 14, tint: DS.Color.statusWorking)
643640
.transition(.scale.combined(with: .opacity))
644641
case .idle:
645642
EmptyView()

Notchy/SessionTabBar.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,11 @@ struct SessionTab: View {
171171
Group {
172172
switch terminalStatus {
173173
case .working:
174-
NotchyIcon(kind: .working, size: 9)
175-
.foregroundStyle(DS.Color.statusWorking)
174+
NotchyIcon(kind: .working, size: 9, tint: DS.Color.statusWorking)
176175
case .waitingForInput:
177-
NotchyIcon(kind: .waiting, size: 9)
178-
.foregroundStyle(DS.Color.statusWaiting)
176+
NotchyIcon(kind: .waiting, size: 9, tint: DS.Color.statusWaiting)
179177
case .taskCompleted:
180-
NotchyIcon(kind: .done, size: 9)
181-
.foregroundStyle(DS.Color.statusDone)
178+
NotchyIcon(kind: .done, size: 9, tint: DS.Color.statusDone)
182179
case .idle, .interrupted:
183180
Circle()
184181
.fill(DS.Color.statusIdle.opacity(0.6))

0 commit comments

Comments
 (0)