From c70b8a3c725d20e103c468ff3e7028fefd900452 Mon Sep 17 00:00:00 2001 From: Alexis Drai Date: Thu, 15 Jun 2023 14:23:03 +0200 Subject: [PATCH] :sparkles: Fix #7: Make TaskView editable (#8) Co-authored-by: Alexis Drai Reviewed-on: https://codefirst.iut.uca.fr/git/alexis.drai/oh_the_things_you_ll_do/pulls/8 --- qml/pages/TaskView.qml | 30 +++++++++++----------- translations/oh_the_things_you_ll_do-de.ts | 6 ++++- translations/oh_the_things_you_ll_do.ts | 6 ++++- 3 files changed, 25 insertions(+), 17 deletions(-) diff --git a/qml/pages/TaskView.qml b/qml/pages/TaskView.qml index 29dd465..6bc4a2f 100644 --- a/qml/pages/TaskView.qml +++ b/qml/pages/TaskView.qml @@ -24,28 +24,28 @@ Page { height: 2 * Theme.paddingLarge } - Label { + TextField { + id: titleField text: taskModel.title + label: qsTr("Title") font.pixelSize: Theme.fontSizeExtraLarge + onTextChanged: taskModel.title = text } - Label { - text: qsTr("Description") - font.bold: true - font.pixelSize: Theme.fontSizeLarge - } - - Label { + TextField { + id: descriptionField text: taskModel.description - font.pixelSize: Theme.fontSizeMedium + label: qsTr("Description") + font.pixelSize: Theme.fontSizeLarge + onTextChanged: taskModel.description = text } - Label { - text: qsTr("Priority ") + taskModel.priority - color: taskModel.priority === 0 ? "red" : - taskModel.priority === 1 ? "orange" : - taskModel.priority === 2 ? "blue" : Theme.primaryColor - font.pixelSize: Theme.fontSizeLarge + TextField { + id: priorityField + text: taskModel.priority.toString() + label: qsTr("Priority") + validator: IntValidator { bottom: 0; top: 3 } + onTextChanged: taskModel.priority = parseInt(text) } } } diff --git a/translations/oh_the_things_you_ll_do-de.ts b/translations/oh_the_things_you_ll_do-de.ts index 8a3a687..e1c490e 100644 --- a/translations/oh_the_things_you_ll_do-de.ts +++ b/translations/oh_the_things_you_ll_do-de.ts @@ -15,7 +15,11 @@ - Priority + Title + + + + Priority diff --git a/translations/oh_the_things_you_ll_do.ts b/translations/oh_the_things_you_ll_do.ts index e14f753..fc4fc51 100644 --- a/translations/oh_the_things_you_ll_do.ts +++ b/translations/oh_the_things_you_ll_do.ts @@ -15,7 +15,11 @@ - Priority + Title + + + + Priority