From 220d3193db61d1c533cf09c9eb340d53f5bf2f59 Mon Sep 17 00:00:00 2001 From: AgentSeal Date: Tue, 28 Apr 2026 14:54:15 +0200 Subject: [PATCH] Fix menubar not dimming on inactive screens Drop explicit foregroundColor from the status item attributed string so NSStatusBarButton can apply native inactive-screen dimming. Fixes #170 --- mac/Sources/CodeBurnMenubar/CodeBurnApp.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift b/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift index 7504afc7..c1d002fb 100644 --- a/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift +++ b/mac/Sources/CodeBurnMenubar/CodeBurnApp.swift @@ -281,14 +281,15 @@ final class AppDelegate: NSObject, NSApplicationDelegate, NSPopoverDelegate { let valueText = compact ? (formatted?.asCompactCurrencyWhole() ?? fallback) : " " + (formatted?.asCompactCurrency() ?? fallback) - let color: NSColor = hasPayload ? .labelColor : .secondaryLabelColor + + var textAttrs: [NSAttributedString.Key: Any] = [.font: font, .baselineOffset: -1.0] + if !hasPayload { + textAttrs[.foregroundColor] = NSColor.secondaryLabelColor + } let composed = NSMutableAttributedString() composed.append(NSAttributedString(attachment: attachment)) - composed.append(NSAttributedString( - string: valueText, - attributes: [.font: font, .foregroundColor: color, .baselineOffset: -1.0] - )) + composed.append(NSAttributedString(string: valueText, attributes: textAttrs)) button.attributedTitle = composed }