diff options
author | Frederick Yin <fkfd@fkfd.me> | 2022-04-07 18:27:19 +0800 |
---|---|---|
committer | Frederick Yin <fkfd@fkfd.me> | 2022-04-07 18:27:19 +0800 |
commit | 1c67f456bc1117c68fc7a76fc7bedde78a8f530c (patch) | |
tree | f5675f22e173daed273d5fe8107973eb36317a33 /contents/ui | |
parent | fb5547888f3357df1f8ec1be330c87f8306e9086 (diff) |
Remove delete button
Diffstat (limited to 'contents/ui')
-rw-r--r-- | contents/ui/ActivityView.qml | 13 | ||||
-rw-r--r-- | contents/ui/main.qml | 8 |
2 files changed, 0 insertions, 21 deletions
diff --git a/contents/ui/ActivityView.qml b/contents/ui/ActivityView.qml index b6996ba..c08877a 100644 --- a/contents/ui/ActivityView.qml +++ b/contents/ui/ActivityView.qml @@ -84,18 +84,5 @@ RowLayout { plasmoid.configuration.importantActivities = importantActivities } } - - PlasmaComponents3.ToolButton { - icon.name: "delete" - onClicked: () => { - // avoid non-fatal TypeError due to activityView.parent=null but .width=parent.width - activityView.width = 0 - if (type == "announcement") { - announcementsModel.remove(index) - } else { - assignmentsModel.remove(index) - } - } - } } } diff --git a/contents/ui/main.qml b/contents/ui/main.qml index 1c7d25f..f4eed97 100644 --- a/contents/ui/main.qml +++ b/contents/ui/main.qml @@ -52,8 +52,6 @@ Item { for (let course of courses) { callApi(`/courses/${course[0]}/activity_stream`, 10, activityStream => { // Get activity stream for each course - let announcementCount = 0 - let assignmentCount = 0 activityStream.forEach(activity => { let important = plasmoid.configuration.importantActivities.includes( activity.id.toString() @@ -63,25 +61,21 @@ Item { announcementsModel.append({ type: "announcement", activityId: activity.id, - index: announcementCount, course: course[1], title: activity.title, url: activity.html_url, important, }) - announcementCount++ } else if (activity.type == "Submission") { assignmentsModel.append({ type: "assignment", activityId: activity.id, - index: assignmentCount, course: course[1], title: activity.title, due: activity.assignment.due_at, url: activity.html_url, important, }) - assignmentCount++ } }) }) @@ -113,7 +107,6 @@ Item { id: announcementsModel ListElement { type: "announcement" - index: 0 course: "CS101" title: "Title" url: "https://xkcd.com" @@ -145,7 +138,6 @@ Item { id: assignmentsModel ListElement { type: "assignment" - index: 0 course: "EE210" title: "Title" due: "2022-12-31T23:59:59Z" |