Skip to content

Commit 8fbb26f

Browse files
committed
Use tertiary color for delete buttons
Implementation improvements: - Added optional color parameter to MetadataLabel.makeIconOnly() with backward compatibility - Applied color tinting using withSymbolConfiguration() for proper SF Symbol rendering instead of relying on foregroundColor attributes on NSTextAttachment - Used flatMap to handle optional chaining when creating tinted symbols
1 parent 6a7c71e commit 8fbb26f

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

LlamaBarn/Menu/InstalledModelItemView.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ final class InstalledModelItemView: ItemView, NSGestureRecognizerDelegate {
202202
}
203203

204204
private func makeDeleteButtonText() -> NSAttributedString {
205-
MetadataLabel.makeIconOnly(icon: Symbols.trash)
205+
MetadataLabel.makeIconOnly(icon: Symbols.trash, color: Typography.tertiaryColor)
206206
}
207207

208208
@objc private func performDelete() {

LlamaBarn/Menu/MetadataLabel.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,11 @@ enum MetadataLabel {
77

88
/// Creates an attributed string containing only an icon (no text).
99
/// Used for status indicators like checkmarks.
10-
static func makeIconOnly(icon: NSImage?) -> NSAttributedString {
10+
static func makeIconOnly(icon: NSImage?, color: NSColor? = nil) -> NSAttributedString {
1111
guard let icon else { return NSAttributedString() }
12-
return NSAttributedString(attachment: iconAttachment(for: icon))
12+
let tintedIcon =
13+
color.flatMap { icon.withSymbolConfiguration(.init(paletteColors: [$0])) } ?? icon
14+
return NSAttributedString(attachment: iconAttachment(for: tintedIcon))
1315
}
1416

1517
/// Creates an attributed string with an icon followed by text (e.g., "📦 2.5 GB").

0 commit comments

Comments
 (0)