PWD-3: add context menu to delete passwords

This commit is contained in:
Markus Thielker 2025-01-24 17:45:22 +01:00
parent b8baca3461
commit 2376a1163d
No known key found for this signature in database

View file

@ -62,6 +62,16 @@ struct ListView: View {
.background(selectedItem == password.id ? .blue : .clear)
.foregroundColor(selectedItem == password.id ? .white : (colorScheme == .dark ? .white : .black))
.cornerRadius(8)
.contextMenu {
Button {
selectedItem = nil
viewModel.deletePassword(password)
viewModel.passwords = viewModel.getAllPasswords()
} label: {
Label("Delete", systemImage: "trash")
}
.keyboardShortcut(.delete)
}
}
if isUpdateTextVisible {