on 551c708 help sign in
unity8/qml/Notifications/Notifications.qml
80 lines 2.2 kB history raw
1/*
2 * Copyright (C) 2013 Canonical, Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
17import QtQuick 2.0
18import Ubuntu.Components 0.1
19import "../Components"
21ListView {
22 id: notificationList
24 objectName: "notificationList"
25 interactive: false
27 property real margin
29 delegate: Notification {
30 objectName: "notification" + index
31 anchors {
32 left: parent.left
33 right: parent.right
34 }
35 type: model.type
36 hints: model.hints
37 iconSource: model.icon
38 secondaryIconSource: model.secondaryIcon
39 summary: model.summary
40 body: model.body
41 actions: model.actions
42 notificationId: model.id
43 notification: notificationList.model.getRaw(notificationId)
44 maxHeight: notificationList.height
45 margins: notificationList.margin
47 // make sure there's no opacity-difference between the several
48 // elements in a notification
49 layer.enabled: add.running || remove.running || populate.running
50 }
52 populate: Transition {
53 UbuntuNumberAnimation {
54 property: "opacity"
55 to: 1
56 duration: UbuntuAnimation.SnapDuration
57 }
58 }
60 add: Transition {
61 UbuntuNumberAnimation {
62 property: "opacity"
63 to: 1
64 duration: UbuntuAnimation.SnapDuration
65 }
66 }
68 remove: Transition {
69 UbuntuNumberAnimation {
70 property: "opacity"
71 to: 0
72 }
73 }
75 displaced: Transition {
76 UbuntuNumberAnimation {
77 properties: "x,y"
78 }
79 }