From 7b127127e7dd73fa0b0297db6a8d4fc1b753d0a5 Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Wed, 10 Sep 2025 21:09:28 +0100 Subject: [PATCH] solarium complete idr most of ts cleaned up stuff remove glassbutton --- ShhShell.xcodeproj/project.pbxproj | 4 -- ShhShell/Views/Keys/KeyImporterView.swift | 27 ++++-------- ShhShell/Views/Misc/GlassButton.swift | 49 --------------------- ShhShell/Views/Misc/ViewModifiers.swift | 6 ++- ShhShell/Views/Onboarding/WelcomeView.swift | 43 +++++++++--------- 5 files changed, 34 insertions(+), 95 deletions(-) delete mode 100644 ShhShell/Views/Misc/GlassButton.swift diff --git a/ShhShell.xcodeproj/project.pbxproj b/ShhShell.xcodeproj/project.pbxproj index 43d01f0..bd40d1a 100644 --- a/ShhShell.xcodeproj/project.pbxproj +++ b/ShhShell.xcodeproj/project.pbxproj @@ -96,7 +96,6 @@ A9C897EF2DF1A9A400EF9A5F /* SSHHandler.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */; }; A9CC786B2E4E681400FAEE58 /* RecentsView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786A2E4E681400FAEE58 /* RecentsView.swift */; }; A9CC786D2E4F534600FAEE58 /* History.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9CC786C2E4F534600FAEE58 /* History.swift */; }; - A9D45DD92E7204FF00BA9E4A /* GlassButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */; }; A9D819292E0E904200442D38 /* Theme.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D819282E0E904200442D38 /* Theme.swift */; }; A9D8192D2E0E9EB500442D38 /* ThemeManagerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */; }; A9D8192F2E0F1BEE00442D38 /* ThemeButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */; }; @@ -239,7 +238,6 @@ A9C897EE2DF1A9A400EF9A5F /* SSHHandler.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SSHHandler.swift; sourceTree = ""; }; A9CC786A2E4E681400FAEE58 /* RecentsView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RecentsView.swift; sourceTree = ""; }; A9CC786C2E4F534600FAEE58 /* History.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = History.swift; sourceTree = ""; }; - A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GlassButton.swift; sourceTree = ""; }; A9D819282E0E904200442D38 /* Theme.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Theme.swift; sourceTree = ""; }; A9D8192C2E0E9EB500442D38 /* ThemeManagerView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeManagerView.swift; sourceTree = ""; }; A9D8192E2E0F1BEE00442D38 /* ThemeButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ThemeButton.swift; sourceTree = ""; }; @@ -548,7 +546,6 @@ A93143C52DF61FE300FCD5DB /* ViewModifiers.swift */, A96C90A02E12B87900724253 /* TextBox.swift */, A9835C3B2E17CCA500969508 /* TrafficLights.swift */, - A9D45DD82E7204FF00BA9E4A /* GlassButton.swift */, ); path = Misc; sourceTree = ""; @@ -911,7 +908,6 @@ A9FD37552E143D23005319A8 /* SecKeyConvertible.swift in Sources */, A94B832F2E5B929C00EBA09C /* Backgrounder.swift in Sources */, A96C6AFE2E0C43B600F377FE /* Keypair.swift in Sources */, - A9D45DD92E7204FF00BA9E4A /* GlassButton.swift in Sources */, A90B38322E3E8FC9002B56FC /* AboutView.swift in Sources */, A9C4140C2E096DB7005E3047 /* SSHError.swift in Sources */, A96BE6AA2E116EC000C0FEE9 /* TerminalViewContainer.swift in Sources */, diff --git a/ShhShell/Views/Keys/KeyImporterView.swift b/ShhShell/Views/Keys/KeyImporterView.swift index 727c006..d2dd802 100644 --- a/ShhShell/Views/Keys/KeyImporterView.swift +++ b/ShhShell/Views/Keys/KeyImporterView.swift @@ -59,28 +59,17 @@ struct KeyImporterView: View { } .preferredColorScheme(.dark) .overlay(alignment: .bottom) { - if #available(iOS 26, *) { - Button { - - } label: { - Text("Import") + Button { + keyManager.importKey(type: keyType, priv: privkeyStr, name: keyName) + UINotificationFeedbackGenerator().notificationOccurred(.success) + dismiss() + } label: { + Text("Import") .font(.title) .bold() - } - .modifier(glassButton(prominent: true)) - } else { - Button() { - keyManager.importKey(type: keyType, priv: privkeyStr, name: keyName) - UINotificationFeedbackGenerator().notificationOccurred(.success) - dismiss() - } label: { - Text("Import") - .font(.title) - .bold() - } - .buttonStyle(.borderedProminent) - .padding(.bottom, 15) } + .modifier(glassButton(prominent: true)) + .padding(.bottom, 15) } } } diff --git a/ShhShell/Views/Misc/GlassButton.swift b/ShhShell/Views/Misc/GlassButton.swift deleted file mode 100644 index f683924..0000000 --- a/ShhShell/Views/Misc/GlassButton.swift +++ /dev/null @@ -1,49 +0,0 @@ -// -// GlassButton.swift -// ShhShell -// -// Created by neon443 on 10/09/2025. -// - -import SwiftUI - -struct GlassButton: View { - var action: (() -> Void) - var prominent: Bool = false - @ViewBuilder var label: Label - @ViewBuilder var fallbackLabel: Label - - var body: some View { - if #available(iOS 26, *) { - Button { - action() - } label: { - label - } - .buttonStyle(.glassProminent) - } else { - Button { - action() - } label: { - fallbackLabel - } - } - } -} - -#Preview { - GlassButton( - action: { - - }, - prominent: true, - label: { - Text("iOS 26+") - .padding(5) - }, - fallbackLabel: { - Text("iOS 26+") - .padding(5) - } - ) -} diff --git a/ShhShell/Views/Misc/ViewModifiers.swift b/ShhShell/Views/Misc/ViewModifiers.swift index 3604bfe..4f2882e 100644 --- a/ShhShell/Views/Misc/ViewModifiers.swift +++ b/ShhShell/Views/Misc/ViewModifiers.swift @@ -23,7 +23,11 @@ struct glassButton: ViewModifier { content.buttonStyle(.glass) } } else { - content + if prominent { + content.buttonStyle(.borderedProminent) + } else { + content + } } } } diff --git a/ShhShell/Views/Onboarding/WelcomeView.swift b/ShhShell/Views/Onboarding/WelcomeView.swift index 4c95f62..a4bab85 100644 --- a/ShhShell/Views/Onboarding/WelcomeView.swift +++ b/ShhShell/Views/Onboarding/WelcomeView.swift @@ -17,12 +17,12 @@ struct WelcomeView: View { VStack { VStack(spacing: 20) { if time > 0.1 { - Image("regular") - .resizable().scaledToFit() - .frame(width: 100) - .clipShape(RoundedRectangle(cornerRadius: 22)) - .shadow(color: .white, radius: time > 0.25 ? 5 : 0) - .transition(.scale) + Image("regular") + .resizable().scaledToFit() + .frame(width: 100) + .clipShape(RoundedRectangle(cornerRadius: 22)) + .shadow(color: .white, radius: time > 0.25 ? 5 : 0) + .transition(.scale) } if time > 2 { Text("Welcome") @@ -33,12 +33,12 @@ struct WelcomeView: View { .shadow(color: .white, radius: time > 2.25 ? 0 : 5) } } -// .padding(.top, time > 3 ? 25 : 0) + // .padding(.top, time > 3 ? 25 : 0) if time > 3 { Spacer() } - + WelcomeChunk( systemImage: "bolt.fill", title: "Blazing Fast", @@ -74,28 +74,27 @@ struct WelcomeView: View { Spacer() } if time > 9 { -#if swift(>=6.2) - Button("Continue") { - hostsManager.setOnboarding(to: true) - } - .modifier(glassButton(prominent: true)) -#else Button { hostsManager.setOnboarding(to: true) } label: { - ZStack { - Color.terminalGreen + if #available(iOS 19, *) { Text("Continue") .monospaced() - .bold() + .font(.title) .foregroundStyle(.black) + } else { + ZStack { + Color.terminalGreen + Text("Continue") + .monospaced() + .bold() + .foregroundStyle(.black) + } + .clipShape(RoundedRectangle(cornerRadius: 50)) } - .clipShape(RoundedRectangle(cornerRadius: 50)) } - .buttonStyle(.plain) - .frame(width: 300, height: 50) - .padding(.horizontal, 75) -#endif + .tint(.terminalGreen) + .modifier(glassButton(prominent: true)) } } .animation(.spring, value: time)