From 36b4d28cacf4894c3a41ca5a4f6f2e3536a7c274 Mon Sep 17 00:00:00 2001 From: Joris Date: Mon, 3 Aug 2020 12:38:20 +0200 Subject: Highlight tasks having a description Print a star at the end of tasks names for the tasks that have a description. --- todo/gui/tasks/table/widget.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/todo/gui/tasks/table/widget.py b/todo/gui/tasks/table/widget.py index 2df2764..9e810af 100644 --- a/todo/gui/tasks/table/widget.py +++ b/todo/gui/tasks/table/widget.py @@ -123,7 +123,11 @@ class Widget(QtWidgets.QTableWidget): def update_row(self, row: int): task = self._tasks[row] self.setItem(row, 0, item(age_since(task.created_at))) - self.setItem(row, 1, item(task.name)) + if task.description: + name = task.name + " *" + else: + name = task.name + self.setItem(row, 1, item(name)) self.setCellWidget(row, 2, colored_label(self, todo.gui.tasks.duration.format(task.duration), todo.gui.tasks.duration.color(task.duration))) self.setCellWidget(row, 3, colored_label(self, difficulty.format(task.difficulty), difficulty_color(task.difficulty))) self.setCellWidget(row, 4, colored_label(self, priority.format(task.priority), priority_color(task.priority))) -- cgit v1.2.3