From 3cdfc988b4de612f0da54a4d9450c7c5822f54b5 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Sat, 9 Apr 2022 14:56:05 +0800 Subject: Show "Submitted" instead of due date when applicable --- contents/ui/ActivityView.qml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'contents/ui/ActivityView.qml') diff --git a/contents/ui/ActivityView.qml b/contents/ui/ActivityView.qml index b3ba66c..7bc66ed 100644 --- a/contents/ui/ActivityView.qml +++ b/contents/ui/ActivityView.qml @@ -77,16 +77,18 @@ RowLayout { } humanDueString += " " + Qt.formatTime(due) - - if (pastDue) { - humanDueString += " " + i18n("(missed)") - } return humanDueString } catch (e) { return isoDue // screw it } } + function dueLabelText() { + if (type != "assignment") { return "" } + if (submitted) { return i18n("Submitted") } + return i18n("Due: ") + humanDue(dueAt) + } + RowLayout { Layout.fillWidth: true PlasmaComponents3.CheckBox { @@ -104,13 +106,12 @@ RowLayout { color: important ? PlasmaCore.Theme.negativeTextColor : PlasmaCore.Theme.textColor elide: Text.ElideRight Layout.fillWidth: true - } PlasmaComponents3.Label { id: dueLabel visible: type == "assignment" - text: dueAt ? ("Due: " + humanDue(dueAt)) : "" + text: dueLabelText() color: activityLabel.color Layout.fillWidth: true } -- cgit v1.2.3