From 91e16d1094affe7b4f4cd83ec988c1c35189b657 Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Wed, 2 Sep 2026 12:09:02 +0200 Subject: [PATCH 1/2] Fix - About Forel now displays the app name --- CHANGELOG.md | 5 ++++ Sources/ForelApp/ForelMacApp.swift | 44 ++++++++++++++++++++++++++---- build.sh | 2 ++ 3 files changed, 46 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9bc5ba2..5033c00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,11 @@ All notable changes to Forel are documented here. Format loosely follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/). +## [Unreleased] + +### Fixed +- About Forel now displays the app name, version, build number, copyright, repository, and license link. + ## [1.0.8] - 2026-07-24 ### Fixed diff --git a/Sources/ForelApp/ForelMacApp.swift b/Sources/ForelApp/ForelMacApp.swift index dd86b91..21ee03c 100644 --- a/Sources/ForelApp/ForelMacApp.swift +++ b/Sources/ForelApp/ForelMacApp.swift @@ -45,13 +45,22 @@ struct ForelMacApp: App { .commands { CommandGroup(replacing: .appInfo) { Button("About Forel") { - let version = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "alpha" - let icon = Bundle.module.url(forResource: "AppIcon", withExtension: "png").flatMap { NSImage(contentsOf: $0) } - NSApplication.shared.orderFrontStandardAboutPanel(options: [ + let info = Bundle.main.infoDictionary + let version = info?["CFBundleShortVersionString"] as? String ?? "Development" + let build = info?["CFBundleVersion"] as? String ?? "Development" + var options: [NSApplication.AboutPanelOptionKey: Any] = [ .applicationName: "Forel", .applicationVersion: version, - .applicationIcon: icon as Any, - ]) + .version: "Build \(build)", + .credits: Self.aboutCredits, + ] + + if let icon = Bundle.module.url(forResource: "AppIcon", withExtension: "png") + .flatMap({ NSImage(contentsOf: $0) }) { + options[.applicationIcon] = icon + } + + NSApplication.shared.orderFrontStandardAboutPanel(options: options) } } } @@ -67,4 +76,29 @@ struct ForelMacApp: App { } .windowResizability(.contentSize) } + + private static var aboutCredits: NSAttributedString { + let credits = NSMutableAttributedString(string: "Copyright © 2026 Lab421\n") + let repository = NSAttributedString( + string: "GitHub Repository", + attributes: [.link: URL(string: "https://github.com/lab421/forel")!] + ) + let separator = NSAttributedString(string: " • ") + let license = NSAttributedString( + string: "GPL-3.0-or-later License", + attributes: [.link: URL(string: "https://github.com/lab421/forel/blob/main/LICENSE")!] + ) + credits.append(repository) + credits.append(separator) + credits.append(license) + + let paragraphStyle = NSMutableParagraphStyle() + paragraphStyle.alignment = .center + credits.addAttribute( + .paragraphStyle, + value: paragraphStyle, + range: NSRange(location: 0, length: credits.length) + ) + return credits + } } diff --git a/build.sh b/build.sh index 137c37b..33a4a7b 100755 --- a/build.sh +++ b/build.sh @@ -123,6 +123,8 @@ write_info_plist() { ${version_number} CFBundleVersion ${version_number} + NSHumanReadableCopyright + Copyright © 2026 Lab421 LSMinimumSystemVersion 13.0 LSUIElement From c9118d9fd4ca16074d92488c6ed2a01255b6646f Mon Sep 17 00:00:00 2001 From: Lionel Guichard Date: Wed, 2 Sep 2026 12:12:38 +0200 Subject: [PATCH 2/2] Wip --- CHANGELOG.md | 2 +- Sources/ForelApp/ForelMacApp.swift | 13 ++----------- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5033c00..48d868d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,7 +6,7 @@ All notable changes to Forel are documented here. Format loosely follows ## [Unreleased] ### Fixed -- About Forel now displays the app name, version, build number, copyright, repository, and license link. +- About Forel now displays the app name, version, build number, copyright, and repository link. ## [1.0.8] - 2026-07-24 diff --git a/Sources/ForelApp/ForelMacApp.swift b/Sources/ForelApp/ForelMacApp.swift index 21ee03c..d8ac1d5 100644 --- a/Sources/ForelApp/ForelMacApp.swift +++ b/Sources/ForelApp/ForelMacApp.swift @@ -78,19 +78,10 @@ struct ForelMacApp: App { } private static var aboutCredits: NSAttributedString { - let credits = NSMutableAttributedString(string: "Copyright © 2026 Lab421\n") - let repository = NSAttributedString( - string: "GitHub Repository", + let credits = NSMutableAttributedString( + string: "\nGitHub Repository", attributes: [.link: URL(string: "https://github.com/lab421/forel")!] ) - let separator = NSAttributedString(string: " • ") - let license = NSAttributedString( - string: "GPL-3.0-or-later License", - attributes: [.link: URL(string: "https://github.com/lab421/forel/blob/main/LICENSE")!] - ) - credits.append(repository) - credits.append(separator) - credits.append(license) let paragraphStyle = NSMutableParagraphStyle() paragraphStyle.alignment = .center