From 3b6e5d4a739fbaa242be76486da2b8bfc7b2f7fd Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Wed, 24 Sep 2025 22:22:33 +0100 Subject: [PATCH] small upds --- ShhShell/Host/HostsManager.swift | 6 +++-- ShhShell/ShhShellApp.swift | 26 ++++++++++++--------- ShhShell/Views/About/AboutView.swift | 6 +++++ ShhShell/Views/Onboarding/WelcomeView.swift | 2 +- 4 files changed, 26 insertions(+), 14 deletions(-) diff --git a/ShhShell/Host/HostsManager.swift b/ShhShell/Host/HostsManager.swift index c651db2..e676da3 100644 --- a/ShhShell/Host/HostsManager.swift +++ b/ShhShell/Host/HostsManager.swift @@ -47,11 +47,13 @@ class HostsManager: ObservableObject, @unchecked Sendable { loadFonts() loadSnippets() loadHistory() - self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding") + withAnimation { + self.shownOnboarding = UserDefaults.standard.bool(forKey: "shownOnboarding") + } } func setOnboarding(to newValue: Bool) { - self.shownOnboarding = newValue + withAnimation { self.shownOnboarding = newValue } UserDefaults.standard.set(newValue, forKey: "shownOnboarding") } diff --git a/ShhShell/ShhShellApp.swift b/ShhShell/ShhShellApp.swift index 62033d0..e6db682 100644 --- a/ShhShell/ShhShellApp.swift +++ b/ShhShell/ShhShellApp.swift @@ -10,7 +10,7 @@ import SwiftUI @main struct ShhShellApp: App { @StateObject var sshHandler: SSHHandler - + @StateObject var hostsManager: HostsManager = HostsManager() @StateObject var keyManager: KeyManager @@ -22,18 +22,22 @@ struct ShhShellApp: App { var body: some Scene { WindowGroup { - Group { + ZStack { + hostsManager.selectedTheme.background.suiColor.opacity(0.7) + .ignoresSafeArea(.all) + ContentView( + handler: sshHandler, + hostsManager: hostsManager, + keyManager: keyManager + ) + .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) + .tint(hostsManager.tint) if !hostsManager.shownOnboarding { WelcomeView(hostsManager: hostsManager) - - } else { - ContentView( - handler: sshHandler, - hostsManager: hostsManager, - keyManager: keyManager - ) - .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) - .tint(hostsManager.tint) + .animation(.default, value: hostsManager.shownOnboarding) + .transition(.opacity) + .frame(maxWidth: .infinity, maxHeight: .infinity) + .background(.black) } } .transition(.opacity) diff --git a/ShhShell/Views/About/AboutView.swift b/ShhShell/Views/About/AboutView.swift index 7ef3874..e1ef40f 100644 --- a/ShhShell/Views/About/AboutView.swift +++ b/ShhShell/Views/About/AboutView.swift @@ -50,6 +50,12 @@ struct AboutView: View { } } + Button { + hostsManager.setOnboarding(to: false) + } label: { + Text("Show Welcome") + } + NavigationLink { ShaderTestingView() } label: { diff --git a/ShhShell/Views/Onboarding/WelcomeView.swift b/ShhShell/Views/Onboarding/WelcomeView.swift index a4bab85..7a56475 100644 --- a/ShhShell/Views/Onboarding/WelcomeView.swift +++ b/ShhShell/Views/Onboarding/WelcomeView.swift @@ -17,7 +17,7 @@ struct WelcomeView: View { VStack { VStack(spacing: 20) { if time > 0.1 { - Image("regular") + AppIcon.regular.image .resizable().scaledToFit() .frame(width: 100) .clipShape(RoundedRectangle(cornerRadius: 22))