Add 'Time' and 'Tags' as proper task's properties, also add raw format handling

This commit is contained in:
Vyn 2024-04-11 11:42:13 +02:00
parent 3e7d8b4b70
commit bae67e6851
15 changed files with 142 additions and 49 deletions

View file

@ -18,7 +18,7 @@ ColumnLayout {
signal confirmed
onTaskToEditChanged: {
newTodoContent.text = taskToEdit?.text ?? ""
newTodoContent.text = taskToEdit?.rawFormat ?? "- [ ] "
newTodoDate.text = taskToEdit?.date ?? ""
}
@ -30,16 +30,16 @@ ColumnLayout {
id: newTodoContent
Layout.fillWidth: true
placeholderText: "Enter your new task..."
text: taskToEdit?.text ?? ""
text: taskToEdit?.rawFormat ?? ""
Keys.onReturnPressed: {
if (newTodoContent.text == "") {
return
}
if (taskToEdit && taskToEditIndex !== undefined) {
backend.updateTodo(taskToEditIndex, taskToEdit.state, newTodoContent.text, newTodoDate.text)
backend.updateTodoFromRawFormat(taskToEditIndex, newTodoContent.text, newTodoDate.text)
} else {
backend.addTodo(newTodoContent.text, newTodoDate.text)
backend.addTodoFromRawFormat(newTodoContent.text, newTodoDate.text)
}
form.confirmed()
}