From ecfc0698e9a1c776b36ae977858bbcc46a32a10b Mon Sep 17 00:00:00 2001 From: Erick Sanchez <7268597+nalancer08@users.noreply.github.com> Date: Mon, 26 Oct 2026 11:56:54 -0600 Subject: [PATCH] Use the phone icon in the header and set the running Dock icon --- desktop/NxNativeEasy/main.swift | 21 ++++++++++++++++++--- scripts/build_desktop_app.py | 2 ++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/desktop/NxNativeEasy/main.swift b/desktop/NxNativeEasy/main.swift index 6585bf2..2dc24d3 100644 --- a/desktop/NxNativeEasy/main.swift +++ b/desktop/NxNativeEasy/main.swift @@ -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) } } diff --git a/scripts/build_desktop_app.py b/scripts/build_desktop_app.py index 3e9e196..43d8cbd 100755 --- a/scripts/build_desktop_app.py +++ b/scripts/build_desktop_app.py @@ -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)