on db5e51c help sign in
unity8/Notifications/Notifications.qml
79 lines 2.1 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"
20import "timings.js" as Timings
22ListView {
23 id: notificationList
25 objectName: "notificationList"
26 interactive: false
28 spacing: units.gu(.5)
29 delegate: Notification {
30 objectName: "notification" + index
31 anchors {
32 left: parent.left
33 right: parent.right
34 }
35 type: model.type
36 iconSource: model.icon
37 secondaryIconSource: model.secondaryIcon
38 summary: model.summary
39 body: model.body
40 actions: model.actions
41 notificationId: model.id
42 notification: notificationList.model.getRaw(notificationId)
43 }
45 populate: Transition {
46 NumberAnimation {
47 property: "opacity"
48 to: 1
49 duration: Timings.snapBeat
50 easing.type: Timings.easing
51 }
52 }
54 add: Transition {
55 NumberAnimation {
56 property: "opacity"
57 to: 1
58 duration: Timings.snapBeat
59 easing.type: Timings.easing
60 }
61 }
63 remove: Transition {
64 NumberAnimation {
65 property: "opacity"
66 to: 0
67 duration: Timings.fastBeat
68 easing.type: Timings.easing
69 }
70 }
72 displaced: Transition {
73 NumberAnimation {
74 properties: "x,y"
75 duration: Timings.fastBeat
76 easing.type: Timings.easing
77 }
78 }