Use the phone icon in the header and set the running Dock icon
This commit is contained in:
1 parent
5775b6c109
commit
ecfc0698e9
2 files changed
+20
-3
No files matched your search
@@ -228,6 +228,14 @@ struct CompactWindow: NSViewRepresentable {
|
||||
}
|
||||
}
|
||||
|
||||
enum AppArtwork {
|
||||
static let icon: NSImage = {
|
||||
guard let url=Bundle.main.url(forResource:"BrandIcon",withExtension:"png"),
|
||||
let image=NSImage(contentsOf:url) else {return NSImage(size:NSSize(width:32,height:32))}
|
||||
return image
|
||||
}()
|
||||
}
|
||||
|
||||
struct ContentView: View {
|
||||
@StateObject private var model=BuildModel()
|
||||
private let ink=Color(red:0.93,green:0.94,blue:0.90)
|
||||
@@ -238,8 +246,11 @@ struct ContentView: View {
|
||||
ScrollView {
|
||||
VStack(alignment:.leading,spacing:22) {
|
||||
HStack {
|
||||
Label("nxnative easy",systemImage:"gamecontroller.fill")
|
||||
.font(.system(size:15,weight:.semibold)).foregroundStyle(lime)
|
||||
HStack(spacing:9) {
|
||||
Image(nsImage:AppArtwork.icon).resizable().interpolation(.high)
|
||||
.frame(width:34,height:34).accessibilityHidden(true)
|
||||
Text("nxnative easy").font(.system(size:15,weight:.semibold)).foregroundStyle(lime)
|
||||
}
|
||||
Spacer()
|
||||
Picker(model.text("Idioma de la interfaz"),selection:$model.language) {
|
||||
Text("English").tag(EasyLanguage.english)
|
||||
@@ -408,7 +419,11 @@ struct GameCatalogView: View {
|
||||
|
||||
@main struct NxNativeEasyApp: App {
|
||||
var body: some Scene {
|
||||
WindowGroup("nxnative Easy") {ContentView()}
|
||||
WindowGroup("nxnative Easy") {
|
||||
ContentView().onAppear {
|
||||
NSApplication.shared.applicationIconImage=AppArtwork.icon
|
||||
}
|
||||
}
|
||||
.defaultSize(width:820,height:600)
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import plistlib
|
||||
import subprocess
|
||||
import sys
|
||||
import tempfile
|
||||
import shutil
|
||||
|
||||
REPO=Path(__file__).resolve().parents[1]
|
||||
|
||||
@@ -22,6 +23,7 @@ def main():
|
||||
str(REPO/'desktop/NxNativeEasy/main.swift'),str(REPO/'desktop/NxNativeEasy/Localization.swift'),str(REPO/'desktop/NxNativeEasy/GameCatalog.swift'),'-o',str(macos/'NxNativeEasy'),
|
||||
'-framework','SwiftUI','-framework','AppKit'],check=True)
|
||||
resources=contents/'Resources';resources.mkdir(exist_ok=True)
|
||||
shutil.copy2(REPO/'desktop/NxNativeEasy/Assets/AppIcon.png',resources/'BrandIcon.png')
|
||||
with tempfile.TemporaryDirectory(prefix='nxnative-icon-') as temporary:
|
||||
iconset=Path(temporary)/'AppIcon.iconset';iconset.mkdir()
|
||||
subprocess.run(['xcrun','swift',str(REPO/'desktop/NxNativeEasy/Assets/draw_icon.swift'),str(iconset)],check=True)
|
||||
|
||||
Reference in new issue
Block a user