From d0943f4838e54f0639dccebc199d3453b11cf816 Mon Sep 17 00:00:00 2001 From: Frederick Yin Date: Thu, 7 Apr 2022 09:54:36 +0800 Subject: Add Remove announcement button --- contents/ui/AnnouncementView.qml | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'contents/ui/AnnouncementView.qml') diff --git a/contents/ui/AnnouncementView.qml b/contents/ui/AnnouncementView.qml index 5ce4d64..cba1d00 100644 --- a/contents/ui/AnnouncementView.qml +++ b/contents/ui/AnnouncementView.qml @@ -9,6 +9,7 @@ import org.kde.plasma.components 3.0 as PlasmaComponents3 import org.kde.plasma.extras 2.0 as PlasmaExtras RowLayout { + id: announcementView width: parent.width Layout.fillWidth: true @@ -40,6 +41,11 @@ RowLayout { PlasmaComponents3.ToolButton { icon.name: "delete" + onClicked: () => { + // avoid non-fatal TypeError due to announcementView.parent=null but .width=parent.width + announcementView.width = 0 + announcementsModel.remove(index) + } } } } -- cgit v1.2.3