fix(app): show the actual running app icon in About, not a named lookup

NSImage(named: "AppIcon") doesn't reliably resolve an App Icon
asset-catalog entry on macOS (it stayed nil / fell back to the SF
Symbol placeholder even with a valid icon in the catalog).
NSApp.applicationIconImage is guaranteed to match whatever the Dock
and Finder are actually showing for the running app.
This commit is contained in:
2026-08-14 03:24:12 +01:00
parent 2ee798fb3a
commit 1cfffa67e5
+7 -10
View File
@@ -28,16 +28,13 @@ struct AboutView: View {
var body: some View {
VStack(spacing: 16) {
if let appIcon = NSImage(named: "AppIcon") {
Image(nsImage: appIcon)
.resizable()
.frame(width: 80, height: 80)
} else {
Image(systemName: "text.book.closed.fill")
.font(.system(size: 48))
.foregroundStyle(Color.accentColor)
.frame(width: 80, height: 80)
}
// `NSImage(named: "AppIcon")` doesn't reliably resolve an App
// Icon asset-catalog entry on macOS `NSApp.applicationIconImage`
// is the API that's actually guaranteed to match what the Dock
// and Finder show for the running app.
Image(nsImage: NSApp.applicationIconImage)
.resizable()
.frame(width: 80, height: 80)
VStack(spacing: 4) {
Text(appName)