@@ -40,7 +40,6 @@ StyledItem {
40 property bool fullscreen: false
40 property bool fullscreen: false
41 property int maxHeight
41 property int maxHeight
42 property int margins: units.gu(1)
42 property int margins: units.gu(1)
43− readonly property bool draggable: type !== Notification.SnapDecision || state === "contracted"
45 readonly property real defaultOpacity: 1.0
44 readonly property real defaultOpacity: 1.0
46 property bool hasMouse
45 property bool hasMouse
@@ -99,8 +98,14 @@ StyledItem {
101+ function closeNotification() {
102+ if (notification.actions.count > 1) { // perform the "reject" action
103+ notification.notification.invokeAction(notification.actions.data(1, ActionModel.RoleActionId));
105+ notification.notification.close();
102 Behavior on x {
108 Behavior on x {
104 UbuntuNumberAnimation { easing.type: Easing.OutBounce }
109 UbuntuNumberAnimation { easing.type: Easing.OutBounce }
@@ -153,8 +158,8 @@ StyledItem {
155 onXChanged: {
160 onXChanged: {
156− if (draggable && Math.abs(notification.x) > 0.75 * notification.width) {
161+ if (Math.abs(notification.x) > 0.75 * notification.width) {
157− notification.notification.close()
162+ closeNotification();
@@ -194,7 +199,7 @@ StyledItem {
194 anchors.fill: parent
199 anchors.fill: parent
195 objectName: "interactiveArea"
200 objectName: "interactiveArea"
197− drag.target: draggable ? notification : undefined
202+ drag.target: notification
198 drag.axis: Drag.XAxis
203 drag.axis: Drag.XAxis
199 drag.minimumX: -notification.width
204 drag.minimumX: -notification.width
200 drag.maximumX: notification.width
205 drag.maximumX: notification.width
@@ -221,16 +226,17 @@ StyledItem {
221 width: units.gu(2)
226 width: units.gu(2)
222 height: width
227 height: width
223 radius: width / 2
228 radius: width / 2
224− visible: hasMouse && draggable && (containsMouse || interactiveArea.containsMouse)
229+ visible: hasMouse && (containsMouse || interactiveArea.containsMouse)
225 iconName: "close"
230 iconName: "close"
226 outline: false
231 outline: false
227 color: theme.palette.normal.negative
233 color: theme.palette.normal.negative
228 anchors.horizontalCenter: parent.left
234 anchors.horizontalCenter: parent.left
229 anchors.horizontalCenterOffset: notification.parent.state === "narrow" ? notification.margins / 2 : 0
235 anchors.horizontalCenterOffset: notification.parent.state === "narrow" ? notification.margins / 2 : 0
230 anchors.verticalCenter: parent.top
236 anchors.verticalCenter: parent.top
231 anchors.verticalCenterOffset: notification.parent.state === "narrow" ? notification.margins / 2 : 0
237 anchors.verticalCenterOffset: notification.parent.state === "narrow" ? notification.margins / 2 : 0
233− onClicked: notification.notification.close()
239+ onClicked: closeNotification();