@@ -37,6 +37,7 @@ Item {
3737 property var notification
3838 property color color
3939 property bool fullscreen: false
40+ property bool draggable: notification.type == Notification.SnapDecision && state == "contracted"
4041 property int maxHeight
4142 property int margins
4243 property Gradient greenGradient : Gradient {
@@ -52,7 +53,7 @@ Item {
5253 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0
5354
5455 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
55− opacity: 1 // FIXME: 1 because of LP: #1354406 workaround, has to be 0 really
56+ opacity: 1 - (x / notification.width) // FIXME: 1 because of LP: #1354406 workaround, has to be 0 really
5657
5758 state: {
5859 var result = "";
@@ -89,6 +90,16 @@ Item {
8990 }
9091 }
9192
93+ Behavior on x {
94+ id: normalXBehavior
95+
96+ enabled: draggable
97+ UbuntuNumberAnimation {
98+ duration: UbuntuAnimation.FastDuration
99+ easing.type: Easing.OutBounce
100+ }
101+ }
102+
92103 Behavior on height {
93104 id: normalHeightBehavior
94105
@@ -142,6 +153,12 @@ Item {
142153 opacity: parent.opacity
143154 }
144155
156+ onXChanged: {
157+ if (draggable && notification.x > 0.75 * notification.width) {
158+ notification.notification.close()
159+ }
160+ }
161+
145162 Item {
146163 id: contents
147164 anchors.fill: fullscreen ? nonShapedBack : shapedBack
@@ -189,6 +206,12 @@ Item {
189206
190207 anchors.fill: parent
191208 objectName: "interactiveArea"
209+
210+ drag.target: draggable ? notification : undefined
211+ drag.axis: Drag.XAxis
212+ drag.minimumX: 0
213+ drag.maximumX: notification.width
214+
192215 onClicked: {
193216 if (notification.type == Notification.Interactive) {
194217 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
@@ -196,6 +219,19 @@ Item {
196219 notificationList.currentIndex = index;
197220 }
198221 }
222+ onPressed: {
223+ if (draggable) {
224+ notification.anchors.left = undefined
225+ notification.anchors.right = undefined
226+ }
227+ }
228+ onReleased: {
229+ if (notification.x < notification.width / 2) {
230+ notification.x = 0
231+ } else {
232+ notification.x = notification.width
233+ }
234+ }
199235 }
200236
201237 Column {