on xenial help sign in
Use UnityMenuModel for defining extended snap-decisions.
6b0d314Mirco Müller
Notifications/Notification.qml+47
@@ -17,6 +17,8 @@
17import QtQuick 2.0
17import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Unity.Notifications 1.0
19import Unity.Notifications 1.0
20+import QMenuModel 0.1
21+import Utils 0.1
20
22
21UbuntuShape {
23UbuntuShape {
22 id: notification
24 id: notification
@@ -38,6 +40,22 @@ UbuntuShape {
38
40
39 clip: true
41 clip: true
40
42
43+ UnityMenuModel {
44+ id: menu
45+
46+ property UnityMenuModelPaths paths: UnityMenuModelPaths {
47+ source: hints["x-canonical-private-menu-model"]
48+
49+ busNameHint: "busName"
50+ actionsHint: "actions"
51+ menuObjectPathHint: "menuPath"
52+ }
53+
54+ busName: paths.busName
55+ actions: paths.actions
56+ menuObjectPath: paths.menuObjectPath
57+ }
58+
41 Behavior on implicitHeight {
59 Behavior on implicitHeight {
42 id: heightBehavior
60 id: heightBehavior
43
61
@@ -141,6 +159,35 @@ UbuntuShape {
141 }
159 }
142 }
160 }
143
161
162+ ListView {
163+ id: dialogListView
164+
165+ objectName: "dialogListView"
166+ spacing: units.gu(2)
167+ interactive: false
168+
169+ visible: count > 0
170+ height: childrenRect.height
171+
172+ anchors {
173+ left: parent.left
174+ right: parent.right
175+ }
176+
177+ model: menu
178+
179+ delegate: NotificationMenuItemFactory {
180+ anchors {
181+ left: parent.left
182+ right: parent.right
183+ }
184+
185+ menuModel: menu
186+ menuData: model
187+ menuIndex: index
188+ }
189+ }
190+
144 Item {
191 Item {
145 id: buttonRow
192 id: buttonRow
146
193