on xenial help sign in
Initial implementation of synchronous (aka confirmation) notification support.
commit4920ee1840c4a3bcac36b9b0dd9698adef243ec4 authorMirco Müller <mirco.mueller@ubuntu.com> dateThu 31 Jul 2014, 13:14 (12 years ago) parentd6e0fa4
2 files changed+41−11
qml/Notifications/Notification.qml+40−11 qml/Notifications/Notifications.qml+1
qml/Notifications/Notification.qml+40−11
@@ -30,6 +30,7 @@ Item {
3030 property alias secondaryIconSource: secondaryIcon.source
3131 property alias summary: summaryLabel.text
3232 property alias body: bodyLabel.text
33+ property alias value: valueIndicator.value
3334 property var actions
3435 property var notificationId
3536 property var type
@@ -51,7 +52,7 @@ Item {
5152 objectName: "background"
5253 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 2) : 0
5354
54− color: Qt.rgba(0.132, 0.117, 0.109, 0.97)
55+ color: type == Notification.Confirmation && notificationList.useModal && !greeter.shown ? "#eaeaea" : Qt.rgba(0.132, 0.117, 0.109, 0.97)
5556 opacity: 0
5657
5758 state: {
@@ -226,18 +227,18 @@ Item {
226227 width: units.gu(6)
227228 height: units.gu(6)
228229 shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
229− visible: iconSource !== undefined && iconSource != ""
230− }
230+ visible: iconSource !== undefined && iconSource != "" && type != Notification.Confirmation
231+ }
231232
232− Image {
233− id: secondaryIcon
233+ Image {
234+ id: secondaryIcon
234235
235− objectName: "secondaryIcon"
236− width: units.gu(2)
237− height: units.gu(2)
238− visible: source !== undefined && source != ""
239− fillMode: Image.PreserveAspectCrop
240− }
236+ objectName: "secondaryIcon"
237+ width: units.gu(2)
238+ height: units.gu(2)
239+ visible: source !== undefined && source != ""
240+ fillMode: Image.PreserveAspectCrop
241+ }
241242
242243 Column {
243244 id: labelColumn
@@ -253,6 +254,7 @@ Item {
253254 left: parent.left
254255 right: parent.right
255256 }
257+ visible: type != Notification.Confirmation
256258 fontSize: "medium"
257259 font.bold: true
258260 color: Theme.palette.selected.backgroundText
@@ -278,6 +280,33 @@ Item {
278280 }
279281 }
280282
283+ ShapedIcon {
284+ id: centeredIcon
285+
286+ objectName: "centeredIcon"
287+ width: units.gu(6)
288+ height: width
289+ shaped: notification.hints["x-canonical-non-shaped-icon"] == "true" ? false : true
290+ fileSource: icon.fileSource
291+ visible: fileSource !== undefined && fileSource != "" && type == Notification.Confirmation
292+ anchors.horizontalCenter: parent.horizontalCenter
293+ }
294+
295+ ProgressBar {
296+ id: valueIndicator
297+ objectName: "valueIndicator"
298+ visible: type == Notification.Confirmation
299+ minimumValue: 0.0
300+ maximumValue: 100.0
301+ height: units.gu(1)
302+ showProgressPercentage: false
303+
304+ anchors {
305+ left: parent.left
306+ right: parent.right
307+ }
308+ }
309+
281310 Column {
282311 id: dialogColumn
283312 objectName: "dialogListView"
qml/Notifications/Notifications.qml+1
@@ -55,6 +55,7 @@ ListView {
5555 secondaryIconSource: model.secondaryIcon
5656 summary: model.summary
5757 body: model.body
58+ value: model.value
5859 actions: model.actions
5960 notificationId: model.id
6061 notification: notificationList.model.getRaw(notificationId)