diff options
author | Christian Cleberg <hello@cleberg.net> | 2024-01-04 14:45:39 -0600 |
---|---|---|
committer | Christian Cleberg <hello@cleberg.net> | 2024-01-04 14:45:39 -0600 |
commit | d44bb7d21187baae4c36cc8f920e980ab44057b0 (patch) | |
tree | 6421f0df513e4206ba557744806e46a5ad3398d0 | |
parent | cf13000e6fb6af629d7659dd3e99ccb9496e6462 (diff) | |
download | libre-tasks-d44bb7d21187baae4c36cc8f920e980ab44057b0.tar.gz libre-tasks-d44bb7d21187baae4c36cc8f920e980ab44057b0.tar.bz2 libre-tasks-d44bb7d21187baae4c36cc8f920e980ab44057b0.zip |
feat: add swipe action for completion
-rw-r--r-- | LibreTasks/ContentView.swift | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/LibreTasks/ContentView.swift b/LibreTasks/ContentView.swift index 2ea9013..8847716 100644 --- a/LibreTasks/ContentView.swift +++ b/LibreTasks/ContentView.swift @@ -96,12 +96,21 @@ struct ContentView: View { Spacer() (Text("[#") + Text(task.taskPriority) + Text("]")) } - .swipeActions(edge: .trailing) { + .swipeActions(edge: .leading) { Button(role: .destructive) { print("\(task.taskItem) is being deleted.") } label: { Label("Delete", systemImage: "trash") } + } + .swipeActions(edge: .trailing) { + Button() { + print("\(task.taskItem) is being marked as complete.") + // TODO: Add method to complete message in the DataStore & move to Archive list + } label: { + Label("Complete", systemImage: "checkmark") + } + .tint(.green) Button() { print("\(task.taskItem) is being edited.") // TODO: Add method to edit message in the DataStore |