mirror of https://github.com/cirruslabs/tart.git
Add App Icon (#23)
This commit is contained in:
parent
75b5d63387
commit
e100cc0d7f
|
|
@ -0,0 +1 @@
|
||||||
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|
@ -5,8 +5,8 @@
|
||||||
"kind" : "remoteSourceControl",
|
"kind" : "remoteSourceControl",
|
||||||
"location" : "https://github.com/apple/swift-argument-parser",
|
"location" : "https://github.com/apple/swift-argument-parser",
|
||||||
"state" : {
|
"state" : {
|
||||||
"revision" : "82905286cc3f0fa8adc4674bf49437cab65a8373",
|
"revision" : "f3c9084a71ef4376f2fabbdf1d3d90a49f1fabdb",
|
||||||
"version" : "1.1.1"
|
"version" : "1.1.2"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
|
||||||
|
|
@ -7,13 +7,19 @@ let package = Package(
|
||||||
platforms: [
|
platforms: [
|
||||||
.macOS(.v12)
|
.macOS(.v12)
|
||||||
],
|
],
|
||||||
|
products: [
|
||||||
|
.executable(name: "tart", targets: ["tart"])
|
||||||
|
],
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.1.1"),
|
.package(url: "https://github.com/apple/swift-argument-parser", from: "1.1.2"),
|
||||||
],
|
],
|
||||||
targets: [
|
targets: [
|
||||||
.executableTarget(name: "tart",
|
.executableTarget(name: "tart",
|
||||||
dependencies: [
|
dependencies: [
|
||||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||||
|
],
|
||||||
|
resources: [
|
||||||
|
.process("Resources/Icon.png")
|
||||||
]),
|
]),
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,8 @@ struct Run: AsyncParsableCommand {
|
||||||
var name: String
|
var name: String
|
||||||
|
|
||||||
@Flag var noGraphics: Bool = false
|
@Flag var noGraphics: Bool = false
|
||||||
|
|
||||||
|
@MainActor
|
||||||
func run() async throws {
|
func run() async throws {
|
||||||
let vmDir = try VMStorage().read(name)
|
let vmDir = try VMStorage().read(name)
|
||||||
vm = try VM(vmDir: vmDir)
|
vm = try VM(vmDir: vmDir)
|
||||||
|
|
@ -33,9 +34,12 @@ struct Run: AsyncParsableCommand {
|
||||||
dispatchMain()
|
dispatchMain()
|
||||||
} else {
|
} else {
|
||||||
// UI mumbo-jumbo
|
// UI mumbo-jumbo
|
||||||
let nsApp = await NSApplication.shared
|
let nsApp = NSApplication.shared
|
||||||
await nsApp.setActivationPolicy(.regular)
|
nsApp.setActivationPolicy(.regular)
|
||||||
await nsApp.activate(ignoringOtherApps: true)
|
nsApp.activate(ignoringOtherApps: true)
|
||||||
|
|
||||||
|
let icon = Bundle.module.image(forResource: "Icon.png")
|
||||||
|
nsApp.applicationIconImage = icon
|
||||||
|
|
||||||
struct MainApp: App {
|
struct MainApp: App {
|
||||||
var body: some Scene {
|
var body: some Scene {
|
||||||
|
|
@ -57,7 +61,7 @@ struct Run: AsyncParsableCommand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
await MainApp.main()
|
MainApp.main()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,3 @@
|
||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:ffcf68332fd5a63ddd23ee941bbe45ec330c2d111aa17e252526a03b4b30facb
|
||||||
|
size 252602
|
||||||
Loading…
Reference in New Issue