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",
|
||||
"location" : "https://github.com/apple/swift-argument-parser",
|
||||
"state" : {
|
||||
"revision" : "82905286cc3f0fa8adc4674bf49437cab65a8373",
|
||||
"version" : "1.1.1"
|
||||
"revision" : "f3c9084a71ef4376f2fabbdf1d3d90a49f1fabdb",
|
||||
"version" : "1.1.2"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
|
|
|||
|
|
@ -7,13 +7,19 @@ let package = Package(
|
|||
platforms: [
|
||||
.macOS(.v12)
|
||||
],
|
||||
products: [
|
||||
.executable(name: "tart", targets: ["tart"])
|
||||
],
|
||||
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: [
|
||||
.executableTarget(name: "tart",
|
||||
dependencies: [
|
||||
.product(name: "ArgumentParser", package: "swift-argument-parser"),
|
||||
],
|
||||
resources: [
|
||||
.process("Resources/Icon.png")
|
||||
]),
|
||||
]
|
||||
)
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ struct Run: AsyncParsableCommand {
|
|||
var name: String
|
||||
|
||||
@Flag var noGraphics: Bool = false
|
||||
|
||||
|
||||
@MainActor
|
||||
func run() async throws {
|
||||
let vmDir = try VMStorage().read(name)
|
||||
vm = try VM(vmDir: vmDir)
|
||||
|
|
@ -33,9 +34,12 @@ struct Run: AsyncParsableCommand {
|
|||
dispatchMain()
|
||||
} else {
|
||||
// UI mumbo-jumbo
|
||||
let nsApp = await NSApplication.shared
|
||||
await nsApp.setActivationPolicy(.regular)
|
||||
await nsApp.activate(ignoringOtherApps: true)
|
||||
let nsApp = NSApplication.shared
|
||||
nsApp.setActivationPolicy(.regular)
|
||||
nsApp.activate(ignoringOtherApps: true)
|
||||
|
||||
let icon = Bundle.module.image(forResource: "Icon.png")
|
||||
nsApp.applicationIconImage = icon
|
||||
|
||||
struct MainApp: App {
|
||||
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