From 18d708cf0c71659144cdfddc8c528dae99463bc5 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Sun, 3 Aug 2025 10:36:01 +0100 Subject: [PATCH] got it to return the high quality icon from the asset catalog made the about view look nicer --- ShhShell/Misc/Bundle.swift | 9 +++++---- ShhShell/Views/About/AboutView.swift | 21 ++++++++++++++++----- ShhShell/Views/ContentView.swift | 2 +- 3 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ShhShell/Misc/Bundle.swift b/ShhShell/Misc/Bundle.swift index 0393ac7..497b60c 100644 --- a/ShhShell/Misc/Bundle.swift +++ b/ShhShell/Misc/Bundle.swift @@ -22,9 +22,10 @@ extension Bundle { extension UIImage { var appIcon: Image { - let fallback = Image(uiImage: UIImage()) - guard let filename = Bundle.main.iconFilename else { return fallback } - guard let uiImage = UIImage(named: filename) else { return fallback } - return Image(uiImage: uiImage) +// let fallback = Image(uiImage: UIImage()) +// guard let filename = Bundle.main.iconFilename else { return fallback } +// guard let uiImage = UIImage(named: filename) else { return fallback } +// return uiImage + return Image("Icon") } } diff --git a/ShhShell/Views/About/AboutView.swift b/ShhShell/Views/About/AboutView.swift index 0893641..792894b 100644 --- a/ShhShell/Views/About/AboutView.swift +++ b/ShhShell/Views/About/AboutView.swift @@ -8,15 +8,26 @@ import SwiftUI struct AboutView: View { + @ObservedObject var hostsManager: HostsManager + var body: some View { - HStack { - UIImage().appIcon - Image(uiImage: UIImage(named: "AppIcon") ?? UIImage()) - Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + ZStack { + hostsManager.selectedTheme.background.suiColor.opacity(0.7) + .ignoresSafeArea(.all) + List { + HStack { + UIImage().appIcon + .resizable().scaledToFit() + .frame(width: 100) + .clipShape(RoundedRectangle(cornerRadius: 26)) + Text(/*@START_MENU_TOKEN@*/"Hello, World!"/*@END_MENU_TOKEN@*/) + } + } + .scrollContentBackground(.hidden) } } } #Preview { - AboutView() + AboutView(hostsManager: HostsManager()) } diff --git a/ShhShell/Views/ContentView.swift b/ShhShell/Views/ContentView.swift index 0bfb07f..deb0cb1 100644 --- a/ShhShell/Views/ContentView.swift +++ b/ShhShell/Views/ContentView.swift @@ -65,7 +65,7 @@ struct ContentView: View { Section { NavigationLink { - AboutView() + AboutView(hostsManager: hostsManager) } label: { Label("About", systemImage: "info.square") }