diff options
author | Joris | 2020-05-10 15:17:55 +0200 |
---|---|---|
committer | Joris | 2020-05-10 15:17:55 +0200 |
commit | 0863478038df43d5ab3de734263b5b2f4b224984 (patch) | |
tree | e487ff6c621e5b2d9e144dca640bdcdb2dbb13c8 /src/gui/tasks/table | |
parent | 80ceab3620cc09b10612991ac982ea42745c2a07 (diff) |
Show duration with a green orange red color
Diffstat (limited to 'src/gui/tasks/table')
-rw-r--r-- | src/gui/tasks/table/model.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/tasks/table/model.py b/src/gui/tasks/table/model.py index 062ded6..8374d03 100644 --- a/src/gui/tasks/table/model.py +++ b/src/gui/tasks/table/model.py @@ -48,10 +48,13 @@ class TableModel(QtCore.QAbstractTableModel): return priority.format(task.priority) elif index.column() == 5: return task.tag - elif role == Qt.ForegroundRole and index.column() == 3: - return QtGui.QBrush(difficulty_color(task.difficulty)) - elif role == Qt.ForegroundRole and index.column() == 4: - return QtGui.QBrush(priority_color(task.priority)) + elif role == Qt.ForegroundRole: + if index.column() == 2: + return QtGui.QBrush(gui.tasks.duration.color(task.duration)) + elif index.column() == 3: + return QtGui.QBrush(difficulty_color(task.difficulty)) + elif index.column() == 4: + return QtGui.QBrush(priority_color(task.priority)) else: return QtCore.QVariant() |