on xenial help sign in
Tweaks to notifications to improve spec-compliance.

- updated notifications-qmltest to reflect the use of a variant-map for the hints - made text-fields as heigh as buttons - made the summary align horizontally to the icon - updated button-height and bubble-background. Approved by PS Jenkins bot, Michał Sawicz.

commitc876845cecdec3d943b799994b7bc136b15c2e84 authorMirco Müller <mirco.mueller@ubuntu.com> dateTue 8 Oct 2013, 19:54 (13 years ago) parent31bb5ed0083ebf
3 files changed+15−14
Notifications/Notification.qml+6−3 Notifications/NotificationMenuItemFactory.qml+2−9 tests/qmltests/Notifications/tst_Notifications.qml+7−2
Notifications/Notification.qml+6−3
@@ -35,8 +35,9 @@ UbuntuShape {
3535
3636 objectName: "background"
3737 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)
3939 opacity: 0
40+ radius: "medium"
4041
4142 clip: true
4243
@@ -128,6 +129,8 @@ UbuntuShape {
128129 id: labelColumn
129130 width: parent.width - x
130131
132+ anchors.verticalCenter: (icon.visible && !bodyLabel.visible) ? icon.verticalCenter : undefined
133+
131134 Label {
132135 id: summaryLabel
133136
@@ -191,7 +194,7 @@ UbuntuShape {
191194 right: parent.right
192195 }
193196 visible: notification.type == Notification.SnapDecision
194− height: units.gu(4)
197+ height: units.gu(5)
195198
196199 property real buttonWidth: (width - contentColumn.spacing) / 2
197200 property bool expanded
@@ -282,7 +285,7 @@ UbuntuShape {
282285 }
283286
284287 text: loader.actionLabel
285− height: units.gu(4)
288+ height: units.gu(5)
286289 gradient: UbuntuColors.greyGradient
287290 onClicked: notification.notification.invokeAction(loader.actionId)
288291 }
Notifications/NotificationMenuItemFactory.qml+2−9
@@ -41,19 +41,14 @@ Loader {
4141 if (component !== undefined) {
4242 return component;
4343 }
44− } else {
45− if (menuData.isSeparator) {
46− return divMenu;
47− }
4844 }
49− return standardMenu;
5045 }
5146
5247 Component {
5348 id: textfield
5449
5550 Column {
56− spacing: units.gu(.5)
51+ spacing: units.gu(2)
5752
5853 anchors.left: parent.left; anchors.right: parent.right
5954
@@ -63,8 +58,6 @@ Loader {
6358 }
6459
6560 Label {
66− fontSize: "medium"
67− color: "white"
6861 text: menuData.label
6962 }
7063
@@ -72,7 +65,7 @@ Loader {
7265 id: textfield
7366
7467 anchors.left: parent.left; anchors.right: parent.right
75−
68+ height: units.gu(5)
7669 onTextChanged: {
7770 menuModel.changeState(menuIndex, text);
7871 }
tests/qmltests/Notifications/tst_Notifications.qml+7−2
@@ -48,7 +48,7 @@ Row {
4848 function addSnapDecisionNotification() {
4949 var n = {
5050 type: Notification.SnapDecision,
51− hints: Notification.ButtonTint,
51+ hints: {"x-canonical-private-button-tint": "true"},
5252 summary: "Tom Ato",
5353 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.",
5454 icon: "../graphics/avatars/funky.png",
@@ -192,7 +192,7 @@ Row {
192192 {
193193 tag: "Snap Decision with secondary icon and button-tint",
194194 type: Notification.SnapDecision,
195− hints: Notification.ButtonTint,
195+ hints: {"x-canonical-private-button-tint": "true"},
196196 summary: "Tom Ato",
197197 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.",
198198 icon: "../graphics/avatars/funky.png",
@@ -213,6 +213,7 @@ Row {
213213 {
214214 tag: "Ephemeral notification - icon-summary layout",
215215 type: Notification.Ephemeral,
216+ hints: {"x-canonical-private-button-tint": "false"},
216217 summary: "Photo upload completed",
217218 body: "",
218219 icon: "",
@@ -229,6 +230,7 @@ Row {
229230 {
230231 tag: "Ephemeral notification - check suppression of secondary icon for icon-summary layout",
231232 type: Notification.Ephemeral,
233+ hints: {"x-canonical-private-button-tint": "false"},
232234 summary: "New comment successfully published",
233235 body: "",
234236 icon: "",
@@ -245,6 +247,7 @@ Row {
245247 {
246248 tag: "Interactive notification",
247249 type: Notification.Interactive,
250+ hints: {"x-canonical-private-button-tint": "false"},
248251 summary: "Interactive notification",
249252 body: "This is a notification that can be clicked",
250253 icon: "../graphics/avatars/amanda.png",
@@ -261,6 +264,7 @@ Row {
261264 {
262265 tag: "Snap Decision without secondary icon and no button-tint",
263266 type: Notification.SnapDecision,
267+ hints: {"x-canonical-private-button-tint": "false"},
264268 summary: "Bro Coly",
265269 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.",
266270 icon: "../graphics/avatars/anna_olsson.png",
@@ -278,6 +282,7 @@ Row {
278282 {
279283 tag: "Ephemeral notification",
280284 type: Notification.Ephemeral,
285+ hints: {"x-canonical-private-button-tint": "false"},
281286 summary: "Cole Raby",
282287 body: "I did not expect it to be that late.",
283288 icon: "../graphics/avatars/funky.png",