mirror of
https://codeberg.org/vyn/mirai.git
synced 2025-07-03 18:23:19 +00:00
Add 'Time' and 'Tags' as proper task's properties, also add raw format handling
This commit is contained in:
parent
3e7d8b4b70
commit
bae67e6851
15 changed files with 142 additions and 49 deletions
|
@ -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()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue