on xenial help sign in
Tweaks to notifications to improve spec-compliance.
c876845Mirco Müller
Notifications/Notification.qml+6−3
@@ -35,8 +35,9 @@ UbuntuShape {
35
35
36 objectName: "background"
36 objectName: "background"
37 implicitHeight: contentColumn.height + contentColumn.spacing * 2
37 implicitHeight: contentColumn.height + contentColumn.spacing * 2
38− color: Qt.rgba(0, 0, 0, 0.85)
38+ color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
39 opacity: 0
39 opacity: 0
40+ radius: "medium"
40
41
41 clip: true
42 clip: true
42
43
@@ -128,6 +129,8 @@ UbuntuShape {
128 id: labelColumn
129 id: labelColumn
129 width: parent.width - x
130 width: parent.width - x
130
131
132+ anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
133+
131 Label {
134 Label {
132 id: summaryLabel
135 id: summaryLabel
133
136
@@ -191,7 +194,7 @@ UbuntuShape {
191 right: parent.right
194 right: parent.right
192 }
195 }
193 visible: notification.type == Notification.SnapDecision
196 visible: notification.type == Notification.SnapDecision
194− height: units.gu(4)
197+ height: units.gu(5)
195
198
196 property real buttonWidth: (width - contentColumn.spacing) / 2
199 property real buttonWidth: (width - contentColumn.spacing) / 2
197 property bool expanded
200 property bool expanded
@@ -282,7 +285,7 @@ UbuntuShape {
282 }
285 }
283
286
284 text: loader.actionLabel
287 text: loader.actionLabel
285− height: units.gu(4)
288+ height: units.gu(5)
286 gradient: UbuntuColors.greyGradient
289 gradient: UbuntuColors.greyGradient
287 onClicked: notification.notification.invokeAction(loader.actionId)
290 onClicked: notification.notification.invokeAction(loader.actionId)
288 }
291 }
Notifications/NotificationMenuItemFactory.qml+2−9
@@ -41,19 +41,14 @@ Loader {
41 if (component !== undefined) {
41 if (component !== undefined) {
42 return component;
42 return component;
43 }
43 }
44− } else {
45− if (menuData.isSeparator) {
46− return divMenu;
47− }
48 }
44 }
49− return standardMenu;
50 }
45 }
51
46
52 Component {
47 Component {
53 id: textfield
48 id: textfield
54
49
55 Column {
50 Column {
56− spacing: units.gu(.5)
51+ spacing: units.gu(2)
57
52
58 anchors.left: parent.left; anchors.right: parent.right
53 anchors.left: parent.left; anchors.right: parent.right
59
54
@@ -63,8 +58,6 @@ Loader {
63 }
58 }
64
59
65 Label {
60 Label {
66− fontSize: "medium"
67− color: "white"
68 text: menuData.label
61 text: menuData.label
69 }
62 }
70
63
@@ -72,7 +65,7 @@ Loader {
72 id: textfield
65 id: textfield
73
66
74 anchors.left: parent.left; anchors.right: parent.right
67 anchors.left: parent.left; anchors.right: parent.right
75−
68+ height: units.gu(5)
76 onTextChanged: {
69 onTextChanged: {
77 menuModel.changeState(menuIndex, text);
70 menuModel.changeState(menuIndex, text);
78 }
71 }
tests/qmltests/Notifications/tst_Notifications.qml+7−2
@@ -48,7 +48,7 @@ Row {
48 function addSnapDecisionNotification() {
48 function addSnapDecisionNotification() {
49 var n = {
49 var n = {
50 type: Notification.SnapDecision,
50 type: Notification.SnapDecision,
51− hints: Notification.ButtonTint,
51+ hints: {"x-canonical-private-button-tint": "true"},
52 summary: "Tom Ato",
52 summary: "Tom Ato",
53 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
53 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
54 icon: "../graphics/avatars/funky.png",
54 icon: "../graphics/avatars/funky.png",
@@ -192,7 +192,7 @@ Row {
192 {
192 {
193 tag: "Snap Decision with secondary icon and button-tint",
193 tag: "Snap Decision with secondary icon and button-tint",
194 type: Notification.SnapDecision,
194 type: Notification.SnapDecision,
195− hints: Notification.ButtonTint,
195+ hints: {"x-canonical-private-button-tint": "true"},
196 summary: "Tom Ato",
196 summary: "Tom Ato",
197 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
197 body: "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.",
198 icon: "../graphics/avatars/funky.png",
198 icon: "../graphics/avatars/funky.png",
@@ -213,6 +213,7 @@ Row {
213 {
213 {
214 tag: "Ephemeral notification - icon-summary layout",
214 tag: "Ephemeral notification - icon-summary layout",
215 type: Notification.Ephemeral,
215 type: Notification.Ephemeral,
216+ hints: {"x-canonical-private-button-tint": "false"},
216 summary: "Photo upload completed",
217 summary: "Photo upload completed",
217 body: "",
218 body: "",
218 icon: "",
219 icon: "",
@@ -229,6 +230,7 @@ Row {
229 {
230 {
230 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
231 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
231 type: Notification.Ephemeral,
232 type: Notification.Ephemeral,
233+ hints: {"x-canonical-private-button-tint": "false"},
232 summary: "New comment successfully published",
234 summary: "New comment successfully published",
233 body: "",
235 body: "",
234 icon: "",
236 icon: "",
@@ -245,6 +247,7 @@ Row {
245 {
247 {
246 tag: "Interactive notification",
248 tag: "Interactive notification",
247 type: Notification.Interactive,
249 type: Notification.Interactive,
250+ hints: {"x-canonical-private-button-tint": "false"},
248 summary: "Interactive notification",
251 summary: "Interactive notification",
249 body: "This is a notification that can be clicked",
252 body: "This is a notification that can be clicked",
250 icon: "../graphics/avatars/amanda.png",
253 icon: "../graphics/avatars/amanda.png",
@@ -261,6 +264,7 @@ Row {
261 {
264 {
262 tag: "Snap Decision without secondary icon and no button-tint",
265 tag: "Snap Decision without secondary icon and no button-tint",
263 type: Notification.SnapDecision,
266 type: Notification.SnapDecision,
267+ hints: {"x-canonical-private-button-tint": "false"},
264 summary: "Bro Coly",
268 summary: "Bro Coly",
265 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
269 body: "At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.",
266 icon: "../graphics/avatars/anna_olsson.png",
270 icon: "../graphics/avatars/anna_olsson.png",
@@ -278,6 +282,7 @@ Row {
278 {
282 {
279 tag: "Ephemeral notification",
283 tag: "Ephemeral notification",
280 type: Notification.Ephemeral,
284 type: Notification.Ephemeral,
285+ hints: {"x-canonical-private-button-tint": "false"},
281 summary: "Cole Raby",
286 summary: "Cole Raby",
282 body: "I did not expect it to be that late.",
287 body: "I did not expect it to be that late.",
283 icon: "../graphics/avatars/funky.png",
288 icon: "../graphics/avatars/funky.png",