Add release metadata, about panel, and repo policies

This commit is contained in:
Sebastian Palencsar
2026-06-25 09:48:58 +02:00
parent c5cd05479b
commit 8889efb8ac
7 changed files with 140 additions and 2 deletions

View File

@@ -4,6 +4,8 @@ import SwiftUI
@main
struct BearWaveApp: App {
private static let releaseVersion = "v0.1.0-alpha.1"
private static let buildVersion = "1"
@NSApplicationDelegateAdaptor(AppDelegate.self) private var appDelegate
@State private var model = AppModel()
@State private var isMiniPlayer = false
@@ -32,6 +34,11 @@ struct BearWaveApp: App {
}
.defaultSize(width: Self.windowWidth, height: 720)
.commands {
CommandGroup(replacing: .appInfo) {
Button("About BearWave") {
showAboutPanel()
}
}
CommandGroup(after: .appTermination) {
Button("Play/Pause") {
model.playback.togglePlayPause()
@@ -58,6 +65,22 @@ struct BearWaveApp: App {
}
}
private func showAboutPanel() {
var options: [NSApplication.AboutPanelOptionKey: Any] = [
.applicationName: "BearWave",
.applicationVersion: Self.releaseVersion,
.version: "Build \(Self.buildVersion)"
]
if let iconURL = Bundle.main.url(forResource: "bearwave_about", withExtension: "png"),
let icon = NSImage(contentsOf: iconURL) {
options[.applicationIcon] = icon
}
NSApp.orderFrontStandardAboutPanel(options: options)
NSApp.activate(ignoringOtherApps: true)
}
private func resizeWindow(toMini: Bool) {
let targetSize = toMini ? CGSize(width: 555, height: 110) : CGSize(width: Self.windowWidth, height: 720)
Task { @MainActor in