diff --git a/panels/notification/center/NotifyStaging.qml b/panels/notification/center/NotifyStaging.qml index 01d750f27..f1a547e38 100644 --- a/panels/notification/center/NotifyStaging.qml +++ b/panels/notification/center/NotifyStaging.qml @@ -48,6 +48,16 @@ FocusScope { contentIcon: model.contentIcon contentRowCount: model.contentRowCount + clearButton: SettingActionButton { + icon.name: "clean-alone" + onClicked: function () { + overlapNotify.removedCallback = function() { + overlapNotify.remove() + } + overlapNotify.state = "removing" + } + } + onRemove: function () { console.log("remove overlap", model.id) notifyModel.closeNotify(model.id, NotifyItem.Closed) diff --git a/panels/notification/center/OverlapNotify.qml b/panels/notification/center/OverlapNotify.qml index 2e9c2ad1b..ea94daa19 100644 --- a/panels/notification/center/OverlapNotify.qml +++ b/panels/notification/center/OverlapNotify.qml @@ -18,6 +18,16 @@ NotifyItem { readonly property int overlapItemRadius: 12 property bool enableDismissed: true property var removedCallback + property Component clearButton: AnimationSettingButton { + icon.name: "clean-alone" + text: qsTr("Clean All") + onClicked: function () { + root.removedCallback = function() { + root.remove() + } + root.state = "removing" + } + } signal expand() @@ -64,16 +74,7 @@ NotifyItem { contentIcon: root.contentIcon contentRowCount: root.contentRowCount enableDismissed: root.enableDismissed - clearButton: AnimationSettingButton { - icon.name: "clean-alone" - text: qsTr("Clean All") - onClicked: function () { - root.removedCallback = function() { - root.remove() - } - root.state = "removing" - } - } + clearButton: root.clearButton onDismiss: function () { root.removedCallback = function () { root.dismiss()