made the new key/import key buttons look nicer

made the no snippet/theme icons larger
animated generating a new key
This commit is contained in:
neon443
2025-08-01 12:03:40 +01:00
parent b6ad217f44
commit 1aabaeeb8d
4 changed files with 12 additions and 8 deletions

View File

@@ -95,7 +95,7 @@ class KeyManager: ObservableObject {
try! passwordStore.storeKey(curve25519.genericKeyRepresentation, account: keypair.id.uuidString) try! passwordStore.storeKey(curve25519.genericKeyRepresentation, account: keypair.id.uuidString)
} }
if !keypairs.contains(keypair) { if !keypairs.contains(keypair) {
keypairs.append(keypair) withAnimation { keypairs.append(keypair) }
saveKeypairs() saveKeypairs()
} }
} }

View File

@@ -51,12 +51,16 @@ struct KeyManagerView: View {
.id(keyManager.keypairs) .id(keyManager.keypairs)
} }
Button("Generate a new Ed25519 Key") { CenteredLabel(title: "Generate a key", systemName: "plus")
let comment = UIDevice().model + " at " + Date().formatted(date: .numeric, time: .omitted) .onTapGesture {
keyManager.generateKey(type: .ed25519, comment: comment) 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) { .sheet(isPresented: $showImporter) {
KeyImporterView(keyManager: keyManager) KeyImporterView(keyManager: keyManager)
} }

View File

@@ -21,7 +21,7 @@ struct SnippetManagerView: View {
VStack(alignment: .leading) { VStack(alignment: .leading) {
Image(systemName: "questionmark.square.dashed") Image(systemName: "questionmark.square.dashed")
.resizable().scaledToFit() .resizable().scaledToFit()
.frame(width: 50) .frame(width: 75)
.foregroundStyle(hostsManager.tint) .foregroundStyle(hostsManager.tint)
.shadow(color: hostsManager.tint, radius: 2) .shadow(color: hostsManager.tint, radius: 2)
Text("No Snippets") Text("No Snippets")

View File

@@ -68,7 +68,7 @@ struct ThemeManagerView: View {
.resizable().scaledToFit() .resizable().scaledToFit()
.symbolRenderingMode(.multicolor) .symbolRenderingMode(.multicolor)
} }
.frame(width: 50, height: 50) .frame(width: 75, height: 75)
Text("No themes (yet)") Text("No themes (yet)")
.font(.title) .font(.title)
.padding(.vertical, 10) .padding(.vertical, 10)