@@ -53,6 +53,7 @@ Row {
53 summary: "",
53 summary: "",
56 secondaryIcon: "",
57 secondaryIcon: "",
57 actions: []
58 actions: []
@@ -125,10 +126,11 @@ Row {
125 function addEphemeralIconSummaryNotification() {
126 function addEphemeralIconSummaryNotification() {
126 var n = {
127 var n = {
127 type: Notification.Ephemeral,
128 type: Notification.Ephemeral,
129+ hints: {"x-canonical-non-shaped-icon": "false"},
128 summary: "Photo upload completed",
130 summary: "Photo upload completed",
129 body: "",
131 body: "",
131− secondaryIcon: "../graphics/applicationIcons/facebook.png",
132+ icon: "../graphics/applicationIcons/facebook.png",
132 actions: []
134 actions: []
@@ -148,20 +150,53 @@ Row {
148 mockModel.append(n)
150 mockModel.append(n)
153+ function addConfirmationNotification() {
155+ type: Notification.Confirmation,
156+ hints: {"x-canonical-non-shaped-icon": "true"},
157+ summary: "Confirmation notification",
159+ icon: "image://theme/audio-volume-medium",
168+ function add2ndConfirmationNotification() {
170+ type: Notification.Confirmation,
171+ hints: {"x-canonical-non-shaped-icon": "true",
172+ "x-canonical-value-bar-tint": "true"},
173+ summary: "Confirmation notification",
174+ body: "High Volume",
175+ icon: "image://theme/audio-volume-high",
151 function clearNotifications() {
184 function clearNotifications() {
152− mockModel.clear()
185+ while(mockModel.count > 1) {
186+ remove1stNotification()
155 function remove1stNotification() {
190 function remove1stNotification() {
156− if (mockModel.count > 0)
191+ if (mockModel.count > 1)
157− mockModel.remove(0)
192+ mockModel.remove(1)
160 Rectangle {
195 Rectangle {
161 id: notificationsRect
196 id: notificationsRect
163 width: units.gu(40)
198 width: units.gu(40)
164− height: units.gu(71)
199+ height: units.gu(115)
166 MouseArea{
201 MouseArea{
167 id: clickThroughCatcher
202 id: clickThroughCatcher
@@ -183,7 +218,7 @@ Row {
183 id: interactiveControls
218 id: interactiveControls
185 width: units.gu(30)
220 width: units.gu(30)
186− height: units.gu(81)
221+ height: units.gu(115)
187 color: "grey"
222 color: "grey"
@@ -227,6 +262,18 @@ Row {
227 onClicked: addInteractiveNotification()
262 onClicked: addInteractiveNotification()
267+ text: "add a confirmation"
268+ onClicked: addConfirmationNotification()
273+ text: "add a 2nd confirmation"
274+ onClicked: add2ndConfirmationNotification()
231 width: parent.width
278 width: parent.width
232 text: "remove 1st notification"
279 text: "remove 1st notification"
@@ -264,12 +311,16 @@ Row {
264 summaryVisible: true,
311 summaryVisible: true,
265 bodyVisible: true,
312 bodyVisible: true,
266 iconVisible: true,
313 iconVisible: true,
267− shapedIcon: true,
314+ centeredIconVisible: false,
268− nonShapedIcon: false,
315+ shaped: true,
269 secondaryIconVisible: true,
317 secondaryIconVisible: true,
270 buttonRowVisible: true,
318 buttonRowVisible: true,
271 buttonTinted: true,
319 buttonTinted: true,
272− hasSound: false
320+ hasSound: false,
321+ valueVisible: false,
322+ valueLabelVisible: false,
275 tag: "2-over-1 Snap Decision with button-tint",
326 tag: "2-over-1 Snap Decision with button-tint",
@@ -285,31 +336,37 @@ Row {
285 summaryVisible: true,
336 summaryVisible: true,
286 bodyVisible: true,
337 bodyVisible: true,
287 iconVisible: false,
338 iconVisible: false,
288− shapedIcon: false,
339+ centeredIconVisible: false,
289− nonShapedIcon: false,
340+ shaped: false,
290 secondaryIconVisible: false,
341 secondaryIconVisible: false,
291 buttonRowVisible: false,
342 buttonRowVisible: false,
292 buttonTinted: true,
343 buttonTinted: true,
293− hasSound: false
344+ hasSound: false,
345+ valueVisible: false,
346+ valueLabelVisible: false,
296 tag: "Ephemeral notification - icon-summary layout",
350 tag: "Ephemeral notification - icon-summary layout",
297 type: Notification.Ephemeral,
351 type: Notification.Ephemeral,
298− hints: {"x-canonical-private-affirmative-tint": "false"},
352+ hints: {},
299 summary: "Photo upload completed",
353 summary: "Photo upload completed",
300 body: "",
354 body: "",
302− secondaryIcon: "../graphics/applicationIcons/facebook.png",
355+ icon: "../graphics/applicationIcons/facebook.png",
303 actions: [],
357 actions: [],
304 summaryVisible: true,
358 summaryVisible: true,
305 bodyVisible: false,
359 bodyVisible: false,
306− iconVisible: false,
360+ iconVisible: true,
307− shapedIcon: false,
361+ centeredIconVisible: false,
308− nonShapedIcon: false,
362+ shaped: true,
309− secondaryIconVisible: true,
363+ secondaryIconVisible: false,
310 buttonRowVisible: false,
364 buttonRowVisible: false,
311 buttonTinted: false,
365 buttonTinted: false,
312− hasSound: false
366+ hasSound: false,
367+ valueVisible: false,
368+ valueLabelVisible: false,
315 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
372 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
@@ -326,12 +383,15 @@ Row {
326 bodyVisible: false,
383 bodyVisible: false,
327 interactiveAreaEnabled: false,
384 interactiveAreaEnabled: false,
328 iconVisible: false,
385 iconVisible: false,
329− shapedIcon: false,
386+ centeredIconVisible: false,
330− nonShapedIcon: false,
387+ shaped: false,
331 secondaryIconVisible: true,
388 secondaryIconVisible: true,
332 buttonRowVisible: false,
389 buttonRowVisible: false,
333 buttonTinted: false,
390 buttonTinted: false,
334− hasSound: false
391+ hasSound: false,
392+ valueVisible: false,
393+ valueLabelVisible: false,
337 tag: "Interactive notification",
397 tag: "Interactive notification",
@@ -346,12 +406,15 @@ Row {
346 summaryVisible: true,
406 summaryVisible: true,
347 bodyVisible: true,
407 bodyVisible: true,
348 iconVisible: true,
408 iconVisible: true,
349− shapedIcon: true,
409+ centeredIconVisible: false,
350− nonShapedIcon: false,
410+ shaped: true,
351 secondaryIconVisible: false,
411 secondaryIconVisible: false,
352 buttonRowVisible: false,
412 buttonRowVisible: false,
353 buttonTinted: false,
413 buttonTinted: false,
354− hasSound: true
414+ hasSound: true,
415+ valueVisible: false,
416+ valueLabelVisible: false,
357 tag: "Snap Decision without secondary icon and no button-tint",
420 tag: "Snap Decision without secondary icon and no button-tint",
@@ -367,12 +430,15 @@ Row {
367 summaryVisible: true,
430 summaryVisible: true,
368 bodyVisible: true,
431 bodyVisible: true,
369 iconVisible: true,
432 iconVisible: true,
370− shapedIcon: true,
433+ centeredIconVisible: false,
371− nonShapedIcon: false,
434+ shaped: true,
372 secondaryIconVisible: false,
435 secondaryIconVisible: false,
373 buttonRowVisible: true,
436 buttonRowVisible: true,
374 buttonTinted: false,
437 buttonTinted: false,
375− hasSound: true
438+ hasSound: true,
439+ valueVisible: false,
440+ valueLabelVisible: false,
378 tag: "Ephemeral notification",
444 tag: "Ephemeral notification",
@@ -387,12 +453,15 @@ Row {
387 summaryVisible: true,
453 summaryVisible: true,
388 bodyVisible: true,
454 bodyVisible: true,
389 iconVisible: true,
455 iconVisible: true,
390− shapedIcon: true,
456+ centeredIconVisible: false,
391− nonShapedIcon: false,
457+ shaped: true,
392 secondaryIconVisible: true,
458 secondaryIconVisible: true,
393 buttonRowVisible: false,
459 buttonRowVisible: false,
394 buttonTinted: false,
460 buttonTinted: false,
395− hasSound: true
461+ hasSound: true,
462+ valueVisible: false,
463+ valueLabelVisible: false,
398 tag: "Ephemeral notification with non-shaped icon",
467 tag: "Ephemeral notification with non-shaped icon",
@@ -401,18 +470,68 @@ Row {
401 "x-canonical-non-shaped-icon": "true"},
470 "x-canonical-non-shaped-icon": "true"},
402 summary: "Contacts",
471 summary: "Contacts",
403 body: "Synchronised contacts-database with cloud-storage.",
472 body: "Synchronised contacts-database with cloud-storage.",
404− icon: "../graphics/applicationIcons/contacts-app.png",
473+ icon: "image://theme/contacts-app",
405 secondaryIcon: "",
474 secondaryIcon: "",
406 actions: [],
475 actions: [],
407 summaryVisible: true,
476 summaryVisible: true,
408 bodyVisible: true,
477 bodyVisible: true,
409 iconVisible: true,
478 iconVisible: true,
410− shapedIcon: false,
479+ centeredIconVisible: false,
411− nonShapedIcon: true,
480+ shaped: false,
481+ secondaryIconVisible: false,
482+ buttonRowVisible: false,
483+ buttonTinted: false,
485+ valueVisible: false,
486+ valueLabelVisible: false,
490+ tag: "Confirmation notification with value",
491+ type: Notification.Confirmation,
492+ hints: {"x-canonical-non-shaped-icon": "true"},
495+ icon: "image://theme/audio-volume-medium",
499+ summaryVisible: false,
502+ centeredIconVisible: true,
412 secondaryIconVisible: false,
504 secondaryIconVisible: false,
413 buttonRowVisible: false,
505 buttonRowVisible: false,
414 buttonTinted: false,
506 buttonTinted: false,
415− hasSound: false
507+ hasSound: false,
509+ valueLabelVisible: false,
513+ tag: "Confirmation notification with value, label and tint",
514+ type: Notification.Confirmation,
515+ hints: {"x-canonical-non-shaped-icon": "true",
516+ "x-canonical-value-bar-tint" : "true"},
518+ body: "High Volume",
519+ icon: "image://theme/audio-volume-high",
523+ summaryVisible: false,
526+ centeredIconVisible: true,
528+ secondaryIconVisible: false,
529+ buttonRowVisible: false,
530+ buttonTinted: false,
533+ valueLabelVisible: true,
@@ -450,17 +569,29 @@ Row {
450 waitForRendering(notification);
569 waitForRendering(notification);
452 var icon = findChild(notification, "icon")
571 var icon = findChild(notification, "icon")
453− var shapedIcon = findChild(notification, "shapedIcon")
454− var nonShapedIcon = findChild(notification, "nonShapedIcon")
572+ var centeredIcon = findChild(notification, "centeredIcon")
455 var interactiveArea = findChild(notification, "interactiveArea")
573 var interactiveArea = findChild(notification, "interactiveArea")
456 var secondaryIcon = findChild(notification, "secondaryIcon")
574 var secondaryIcon = findChild(notification, "secondaryIcon")
457 var summaryLabel = findChild(notification, "summaryLabel")
575 var summaryLabel = findChild(notification, "summaryLabel")
458 var bodyLabel = findChild(notification, "bodyLabel")
576 var bodyLabel = findChild(notification, "bodyLabel")
459 var buttonRow = findChild(notification, "buttonRow")
577 var buttonRow = findChild(notification, "buttonRow")
578+ var valueIndicator = findChild(notification, "valueIndicator")
579+ var valueLabel = findChild(notification, "valueLabel")
580+ var innerBar = findChild(notification, "innerBar")
461 compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
582 compare(icon.visible, data.iconVisible, "avatar-icon visibility is incorrect")
584+ compare(icon.shaped, data.shaped, "shaped-status is incorrect")
462− compare(shapedIcon.visible, data.shapedIcon, "shaped-icon visibility is incorrect")
586+ compare(centeredIcon.visible, data.centeredIconVisible, "centered-icon visibility is incorrect")
463− compare(nonShapedIcon.visible, data.nonShapedIcon, "non-shaped-icon visibility is incorrect")
587+ if (centeredIcon.visible) {
588+ compare(centeredIcon.shaped, data.shaped, "shaped-status is incorrect")
590+ compare(valueIndicator.visible, data.valueVisible, "value-indicator visibility is incorrect")
591+ if (valueIndicator.visible) {
592+ verify(innerBar.color === data.valueTinted ? UbuntuColors.orange : "white", "value-bar has the wrong color-tint")
594+ compare(valueLabel.visible, data.valueLabelVisible, "value-label visibility is incorrect")
465 // test input does not fall through
596 // test input does not fall through
466 mouseClick(notification, notification.width / 2, notification.height / 2)
597 mouseClick(notification, notification.width / 2, notification.height / 2)