@@ -37,6 +37,7 @@ Item {
37 property var notification
37 property var notification
38 property color color
38 property color color
39 property bool fullscreen: false
39 property bool fullscreen: false
40+ property bool draggable: notification.type == Notification.SnapDecision && state == "contracted"
40 property int maxHeight
41 property int maxHeight
41 property int margins
42 property int margins
42 property Gradient greenGradient : Gradient {
43 property Gradient greenGradient : Gradient {
@@ -52,7 +53,7 @@ Item {
52 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0
53 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0
54 color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
55 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
58 var result = "";
59 var result = "";
@@ -89,6 +90,16 @@ Item {
97+ UbuntuNumberAnimation {
98+ duration: UbuntuAnimation.FastDuration
99+ easing.type: Easing.OutBounce
92 Behavior on height {
103 Behavior on height {
93 id: normalHeightBehavior
104 id: normalHeightBehavior
@@ -142,6 +153,12 @@ Item {
142 opacity: parent.opacity
153 opacity: parent.opacity
157+ if (draggable && notification.x > 0.75 * notification.width) {
158+ notification.notification.close()
146 id: contents
163 id: contents
147 anchors.fill: fullscreen ? nonShapedBack : shapedBack
164 anchors.fill: fullscreen ? nonShapedBack : shapedBack
@@ -189,6 +206,12 @@ Item {
190 anchors.fill: parent
207 anchors.fill: parent
191 objectName: "interactiveArea"
208 objectName: "interactiveArea"
210+ drag.target: draggable ? notification : undefined
211+ drag.axis: Drag.XAxis
213+ drag.maximumX: notification.width
192 onClicked: {
215 onClicked: {
193 if (notification.type == Notification.Interactive) {
216 if (notification.type == Notification.Interactive) {
194 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
217 notification.notification.invokeAction(actionRepeater.itemAt(0).actionId)
@@ -196,6 +219,19 @@ Item {
196 notificationList.currentIndex = index;
219 notificationList.currentIndex = index;
224+ notification.anchors.left = undefined
225+ notification.anchors.right = undefined
229+ if (notification.x < notification.width / 2) {
232+ notification.x = notification.width