on xenial help sign in
Rename NotificationRenderer's ListView... only pass notification object to delegate for invoking actions
f4e7741Mirco Müller
Notifications/Notification.qml+3−2
@@ -28,6 +28,7 @@ UbuntuShape {
28 property var actions
28 property var actions
29 property var notificationId
29 property var notificationId
30 property var type
30 property var type
31+ property var notification
31
32
32 signal actionInvoked(string buttonId)
33 signal actionInvoked(string buttonId)
33
34
@@ -46,7 +47,7 @@ UbuntuShape {
46 anchors.fill: contentColumn
47 anchors.fill: contentColumn
47 objectName: "interactiveArea"
48 objectName: "interactiveArea"
48 enabled: notification.type == Notification.Interactive
49 enabled: notification.type == Notification.Interactive
49− onClicked: notificationRenderer.model.get(notificationId).invokeAction(actionRepeater.model.actionId(0))
50+ onClicked: notification.notification.invokeAction(actionRepeater.model.actionId(0))
50 }
51 }
51
52
52 Column {
53 Column {
@@ -152,7 +153,7 @@ UbuntuShape {
152 width: (buttonRow.width - buttonRow.spacing) / 2
153 width: (buttonRow.width - buttonRow.spacing) / 2
153 height: units.gu(4)
154 height: units.gu(4)
154 text: label
155 text: label
155− onClicked: notificationRenderer.model.get(notificationId).invokeAction(id)
156+ onClicked: notification.notification.invokeAction(id)
156 }
157 }
157 }
158 }
158 }
159 }
Notifications/Notifications.qml+3−2
@@ -20,9 +20,9 @@ import "../Components"
20import "timings.js" as Timings
20import "timings.js" as Timings
21
21
22ListView {
22ListView {
23− id: notificationRenderer
23+ id: notificationList
24
24
25− objectName: "notificationRenderer"
25+ objectName: "notificationList"
26 interactive: false
26 interactive: false
27
27
28 spacing: units.gu(.5)
28 spacing: units.gu(.5)
@@ -39,6 +39,7 @@ ListView {
39 body: model.body
39 body: model.body
40 actions: model.actions
40 actions: model.actions
41 notificationId: model.id
41 notificationId: model.id
42+ notification: notificationList.model.get(notificationId)
42 }
43 }
43
44
44 populate: Transition {
45 populate: Transition {