on xenial help sign in
Added support for the new sync. notification layout and design requirements to allow the max-volume-warning use-case.
779484bMirco Müller
qml/Notifications/Notification.qml+33−10
@@ -49,7 +49,7 @@ Item {
49 readonly property real contentSpacing: units.gu(2)
49 readonly property real contentSpacing: units.gu(2)
50
50
51 objectName: "background"
51 objectName: "background"
52− implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height + contentSpacing * 2) : 0
52+ implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height - (type === Notification.Confirmation ? units.gu(1) : 0) + contentSpacing * 2) : 0
53
53
54 color: (type === Notification.Confirmation && notificationList.useModal && !greeter.shown) || darkOnBright ? sdLightGrey : Qt.rgba(0.132, 0.117, 0.109, 0.97)
54 color: (type === Notification.Confirmation && notificationList.useModal && !greeter.shown) || darkOnBright ? sdLightGrey : Qt.rgba(0.132, 0.117, 0.109, 0.97)
55 opacity: 1 // FIXME: 1 because of LP: #1354406 workaround, has to be 0 really
55 opacity: 1 // FIXME: 1 because of LP: #1354406 workaround, has to be 0 really
@@ -207,10 +207,10 @@ Item {
207 right: parent.right
207 right: parent.right
208 top: parent.top
208 top: parent.top
209 margins: 0
209 margins: 0
210− topMargin: fullscreen ? 0 : units.gu(2)
210+ topMargin: fullscreen ? 0 : type === Notification.Confirmation ? units.gu(1) : units.gu(2)
211 }
211 }
212
212
213− spacing: units.gu(2)
213+ spacing: type === Notification.Confirmation ? units.gu(1) : units.gu(2)
214
214
215 Row {
215 Row {
216 id: topRow
216 id: topRow
@@ -261,7 +261,7 @@ Item {
261 left: parent.left
261 left: parent.left
262 right: parent.right
262 right: parent.right
263 }
263 }
264− visible: body != ""
264+ visible: body != "" && type !== Notification.Confirmation
265 fontSize: "small"
265 fontSize: "small"
266 color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
266 color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
267 wrapMode: Text.WordWrap
267 wrapMode: Text.WordWrap
@@ -289,7 +289,7 @@ Item {
289 ShapedIcon {
289 ShapedIcon {
290 id: centeredIcon
290 id: centeredIcon
291 objectName: "centeredIcon"
291 objectName: "centeredIcon"
292− width: units.gu(6)
292+ width: units.gu(5)
293 height: width
293 height: width
294 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
294 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
295 fileSource: icon.fileSource
295 fileSource: icon.fileSource
@@ -297,20 +297,43 @@ Item {
297 anchors.horizontalCenter: parent.horizontalCenter
297 anchors.horizontalCenter: parent.horizontalCenter
298 }
298 }
299
299
300− ProgressBar {
300+ Label {
301+ text: body
302+ anchors.horizontalCenter: parent.horizontalCenter
303+ visible: type === Notification.Confirmation && body !== ""
304+ fontSize: "medium"
305+ color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
306+ wrapMode: Text.WordWrap
307+ maximumLineCount: 1
308+ elide: Text.ElideRight
309+ textFormat: Text.PlainText
310+ }
311+
312+ UbuntuShape {
301 id: valueIndicator
313 id: valueIndicator
302 objectName: "valueIndicator"
314 objectName: "valueIndicator"
303 visible: type === Notification.Confirmation
315 visible: type === Notification.Confirmation
304− minimumValue: 0.0
316+ property double value
305− maximumValue: 100.0
306− height: units.gu(1)
307− showProgressPercentage: false
308
317
309 anchors {
318 anchors {
310 left: parent.left
319 left: parent.left
311 right: parent.right
320 right: parent.right
312 margins: contentSpacing
321 margins: contentSpacing
313 }
322 }
323+
324+ height: units.gu(1)
325+ color: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
326+ borderSource: "none"
327+ radius: "small"
328+
329+ UbuntuShape {
330+ id: innerBar
331+ width: valueIndicator.width * valueIndicator.value / 100
332+ height: units.gu(1)
333+ color: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
334+ borderSource: "none"
335+ radius: "small"
336+ }
314 }
337 }
315
338
316 Column {
339 Column {