on xenial help sign in
Added support for the new sync. notification layout and design requirements to allow the max-volume-warning use-case.
commit779484b8401ebb797ac6278d328b943f41f2c48f authorMirco Müller <mirco.mueller@canonical.com> dateFri 10 Oct 2014, 12:57 (12 years ago) parent81b724d
1 file changed+33−10
qml/Notifications/Notification.qml+33−10
qml/Notifications/Notification.qml+33−10
@@ -49,7 +49,7 @@ Item {
4949 readonly property real contentSpacing: units.gu(2)
5050
5151 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
5353
5454 color: (type === Notification.Confirmation && notificationList.useModal && !greeter.shown) || darkOnBright ? sdLightGrey : Qt.rgba(0.132, 0.117, 0.109, 0.97)
5555 opacity: 1 // FIXME: 1 because of LP: #1354406 workaround, has to be 0 really
@@ -207,10 +207,10 @@ Item {
207207 right: parent.right
208208 top: parent.top
209209 margins: 0
210− topMargin: fullscreen ? 0 : units.gu(2)
210+ topMargin: fullscreen ? 0 : type === Notification.Confirmation ? units.gu(1) : units.gu(2)
211211 }
212212
213− spacing: units.gu(2)
213+ spacing: type === Notification.Confirmation ? units.gu(1) : units.gu(2)
214214
215215 Row {
216216 id: topRow
@@ -261,7 +261,7 @@ Item {
261261 left: parent.left
262262 right: parent.right
263263 }
264− visible: body != ""
264+ visible: body != "" && type !== Notification.Confirmation
265265 fontSize: "small"
266266 color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
267267 wrapMode: Text.WordWrap
@@ -289,7 +289,7 @@ Item {
289289 ShapedIcon {
290290 id: centeredIcon
291291 objectName: "centeredIcon"
292− width: units.gu(6)
292+ width: units.gu(5)
293293 height: width
294294 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
295295 fileSource: icon.fileSource
@@ -297,20 +297,43 @@ Item {
297297 anchors.horizontalCenter: parent.horizontalCenter
298298 }
299299
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 {
301313 id: valueIndicator
302314 objectName: "valueIndicator"
303315 visible: type === Notification.Confirmation
304− minimumValue: 0.0
305− maximumValue: 100.0
306− height: units.gu(1)
307− showProgressPercentage: false
316+ property double value
308317
309318 anchors {
310319 left: parent.left
311320 right: parent.right
312321 margins: contentSpacing
313322 }
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+ }
314337 }
315338
316339 Column {