add delete menu

This commit is contained in:
2026-01-28 10:31:24 +01:00
parent d40c73399e
commit 750a096999

View File

@@ -156,6 +156,15 @@ struct StopwatchListItem: View {
.padding(.vertical, 8)
.background(Color(UIColor.systemBackground))
.contentShape(Rectangle())
.contextMenu {
Button(role: .destructive) {
withAnimation {
viewModel.deleteStopwatch(id: stopwatch.id)
}
} label: {
Label("Delete", systemImage: "trash")
}
}
.onDrag {
self.draggingStopwatch = stopwatch
return NSItemProvider(object: stopwatch.id.uuidString as NSString)