mirror of
https://github.com/AgentSeal/codeburn.git
synced 2026-12-03 03:29:51 +00:00
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
This commit is contained in:
parent
dbde5cb52a
commit
220d3193db
1 changed files with 6 additions and 5 deletions
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue