From 1aabaeeb8d715dc53690f5aeb78de5ce6193a61c Mon Sep 17 00:00:00 2001 From: neon443 <69979447+neon443@users.noreply.github.com> Date: Fri, 1 Aug 2025 12:03:40 +0100 Subject: [PATCH] made the new key/import key buttons look nicer made the no snippet/theme icons larger animated generating a new key --- ShhShell/Keys/KeyManager.swift | 2 +- ShhShell/Views/Keys/KeyManagerView.swift | 14 +++++++++----- ShhShell/Views/Snippets/SnippetManagerView.swift | 2 +- ShhShell/Views/Themes/ThemeManagerView.swift | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ShhShell/Keys/KeyManager.swift b/ShhShell/Keys/KeyManager.swift index c35e0ed..5249452 100644 --- a/ShhShell/Keys/KeyManager.swift +++ b/ShhShell/Keys/KeyManager.swift @@ -95,7 +95,7 @@ class KeyManager: ObservableObject { try! passwordStore.storeKey(curve25519.genericKeyRepresentation, account: keypair.id.uuidString) } if !keypairs.contains(keypair) { - keypairs.append(keypair) + withAnimation { keypairs.append(keypair) } saveKeypairs() } } diff --git a/ShhShell/Views/Keys/KeyManagerView.swift b/ShhShell/Views/Keys/KeyManagerView.swift index 353fbd6..9884321 100644 --- a/ShhShell/Views/Keys/KeyManagerView.swift +++ b/ShhShell/Views/Keys/KeyManagerView.swift @@ -51,12 +51,16 @@ struct KeyManagerView: View { .id(keyManager.keypairs) } - Button("Generate a new Ed25519 Key") { - let comment = UIDevice().model + " at " + Date().formatted(date: .numeric, time: .omitted) - keyManager.generateKey(type: .ed25519, comment: comment) - } + CenteredLabel(title: "Generate a key", systemName: "plus") + .onTapGesture { + let comment = UIDevice().model + " at " + Date().formatted(date: .numeric, time: .omitted) + keyManager.generateKey(type: .ed25519, comment: comment) + } - Button("Import Key") { showImporter.toggle() } + CenteredLabel(title: "Import a key", systemName: "square.and.arrow.down") + .onTapGesture { + showImporter.toggle() + } .sheet(isPresented: $showImporter) { KeyImporterView(keyManager: keyManager) } diff --git a/ShhShell/Views/Snippets/SnippetManagerView.swift b/ShhShell/Views/Snippets/SnippetManagerView.swift index 69b41ad..9e006e5 100644 --- a/ShhShell/Views/Snippets/SnippetManagerView.swift +++ b/ShhShell/Views/Snippets/SnippetManagerView.swift @@ -21,7 +21,7 @@ struct SnippetManagerView: View { VStack(alignment: .leading) { Image(systemName: "questionmark.square.dashed") .resizable().scaledToFit() - .frame(width: 50) + .frame(width: 75) .foregroundStyle(hostsManager.tint) .shadow(color: hostsManager.tint, radius: 2) Text("No Snippets") diff --git a/ShhShell/Views/Themes/ThemeManagerView.swift b/ShhShell/Views/Themes/ThemeManagerView.swift index 67a1377..454fb6e 100644 --- a/ShhShell/Views/Themes/ThemeManagerView.swift +++ b/ShhShell/Views/Themes/ThemeManagerView.swift @@ -68,7 +68,7 @@ struct ThemeManagerView: View { .resizable().scaledToFit() .symbolRenderingMode(.multicolor) } - .frame(width: 50, height: 50) + .frame(width: 75, height: 75) Text("No themes (yet)") .font(.title) .padding(.vertical, 10)