From 02131e798cbb19f15342a4a2010a50ab7e59ebfd Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Thu, 28 Aug 2025 20:09:57 +0100 Subject: [PATCH] implement onboarding update welcomeview to fit everything on screen --- ShhShell/ShhShellApp.swift | 19 ++++++++++++------- ShhShell/Views/About/AboutView.swift | 1 - ShhShell/Views/Onboarding/WelcomeChunk.swift | 1 + ShhShell/Views/Onboarding/WelcomeView.swift | 6 +++--- 4 files changed, 16 insertions(+), 11 deletions(-) diff --git a/ShhShell/ShhShellApp.swift b/ShhShell/ShhShellApp.swift index dbc7f0f..89ad0a5 100644 --- a/ShhShell/ShhShellApp.swift +++ b/ShhShell/ShhShellApp.swift @@ -22,13 +22,18 @@ struct ShhShellApp: App { var body: some Scene { WindowGroup { - ContentView( - handler: sshHandler, - hostsManager: hostsManager, - keyManager: keyManager - ) - .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) - .tint(hostsManager.tint) + if !NSUbiquitousKeyValueStore.default.bool(forKey: "shownOnboarding") { + WelcomeView() + } else { + ContentView( + handler: sshHandler, + hostsManager: hostsManager, + keyManager: keyManager + ) + .transition(.opacity) + .colorScheme(hostsManager.selectedTheme.background.luminance > 0.5 ? .light : .dark) + .tint(hostsManager.tint) + } } } } diff --git a/ShhShell/Views/About/AboutView.swift b/ShhShell/Views/About/AboutView.swift index 77907cd..5ee9680 100644 --- a/ShhShell/Views/About/AboutView.swift +++ b/ShhShell/Views/About/AboutView.swift @@ -11,7 +11,6 @@ struct AboutView: View { @ObservedObject var hostsManager: HostsManager var body: some View { - ZStack { hostsManager.selectedTheme.background.suiColor.opacity(0.7) .ignoresSafeArea(.all) diff --git a/ShhShell/Views/Onboarding/WelcomeChunk.swift b/ShhShell/Views/Onboarding/WelcomeChunk.swift index b324e78..0785828 100644 --- a/ShhShell/Views/Onboarding/WelcomeChunk.swift +++ b/ShhShell/Views/Onboarding/WelcomeChunk.swift @@ -38,6 +38,7 @@ struct WelcomeChunk: View { .foregroundStyle(.gray) .font(.footnote) .transition(.blurReplace) + .lineLimit(nil) .multilineTextAlignment(.leading) } } diff --git a/ShhShell/Views/Onboarding/WelcomeView.swift b/ShhShell/Views/Onboarding/WelcomeView.swift index 5f47184..6c4727e 100644 --- a/ShhShell/Views/Onboarding/WelcomeView.swift +++ b/ShhShell/Views/Onboarding/WelcomeView.swift @@ -32,7 +32,7 @@ struct WelcomeView: View { .transition(.blurReplace) } } - .padding(.top, time > 3 ? 50 : 0) +// .padding(.top, time > 3 ? 25 : 0) if time > 3 { Spacer() @@ -90,13 +90,13 @@ struct WelcomeView: View { .clipShape(RoundedRectangle(cornerRadius: 50)) } .buttonStyle(.plain) - .frame(width: .infinity, height: 50) + .frame(width: 300, height: 50) .padding(.horizontal, 75) #endif } } .onDisappear { - + NSUbiquitousKeyValueStore.default.set(true, forKey: "shownOnboarding") } .animation(.spring, value: time) .preferredColorScheme(.dark)