Changeset View
Changeset View
Standalone View
Standalone View
applets/notifications/package/contents/ui/NotificationDelegate.qml
Show All 22 Lines | |||||
23 | import org.kde.plasma.components 2.0 as PlasmaComponents | 23 | import org.kde.plasma.components 2.0 as PlasmaComponents | ||
24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | 24 | import org.kde.plasma.extras 2.0 as PlasmaExtras | ||
25 | import org.kde.kquickcontrolsaddons 2.0 | 25 | import org.kde.kquickcontrolsaddons 2.0 | ||
26 | 26 | | |||
27 | PlasmaComponents.ListItem { | 27 | PlasmaComponents.ListItem { | ||
28 | id: notificationItem | 28 | id: notificationItem | ||
29 | width: popupFlickable.width | 29 | width: popupFlickable.width | ||
30 | 30 | | |||
31 | property ListModel listModel; | ||||
32 | | ||||
31 | opacity: 1-Math.abs(x)/width | 33 | opacity: 1-Math.abs(x)/width | ||
32 | 34 | | |||
33 | enabled: model.hasDefaultAction | 35 | enabled: model.hasDefaultAction | ||
34 | checked: notificationItem.containsMouse | 36 | checked: notificationItem.containsMouse | ||
35 | 37 | | |||
36 | Timer { | 38 | Timer { | ||
37 | interval: 10*60*1000 | 39 | interval: 10*60*1000 | ||
38 | repeat: false | 40 | repeat: false | ||
39 | running: !idleTimeSource.idle | 41 | running: !idleTimeSource.idle | ||
40 | onTriggered: { | 42 | onTriggered: { | ||
41 | if (!notificationsModel.inserting) | 43 | if (!listModel.inserting) | ||
42 | notificationsModel.remove(index) | 44 | listModel.remove(index) | ||
43 | } | 45 | } | ||
44 | } | 46 | } | ||
45 | 47 | | |||
46 | MouseArea { | 48 | MouseArea { | ||
47 | width: parent.width | 49 | width: parent.width | ||
48 | height: childrenRect.height | 50 | height: childrenRect.height | ||
49 | acceptedButtons: Qt.NoButtons | 51 | acceptedButtons: Qt.NoButtons | ||
50 | 52 | | |||
Show All 31 Lines | 82 | NumberAnimation { | |||
82 | properties: "height" | 84 | properties: "height" | ||
83 | to: 0 | 85 | to: 0 | ||
84 | duration: units.longDuration | 86 | duration: units.longDuration | ||
85 | easing.type: Easing.InOutQuad | 87 | easing.type: Easing.InOutQuad | ||
86 | } | 88 | } | ||
87 | ScriptAction { | 89 | ScriptAction { | ||
88 | script: { | 90 | script: { | ||
89 | closeNotification(model.source); | 91 | closeNotification(model.source); | ||
90 | notificationsModel.remove(index); | 92 | listModel.remove(index); | ||
91 | } | 93 | } | ||
92 | } | 94 | } | ||
93 | } | 95 | } | ||
94 | 96 | | |||
95 | SequentialAnimation { | 97 | SequentialAnimation { | ||
96 | id: resetAnimation | 98 | id: resetAnimation | ||
97 | NumberAnimation { | 99 | NumberAnimation { | ||
98 | target: notificationItem | 100 | target: notificationItem | ||
Show All 29 Lines | 129 | for (var key in modelUrls) { | |||
128 | urls.push(modelUrls[key]) | 130 | urls.push(modelUrls[key]) | ||
129 | } | 131 | } | ||
130 | } | 132 | } | ||
131 | 133 | | |||
132 | return urls | 134 | return urls | ||
133 | } | 135 | } | ||
134 | 136 | | |||
135 | onClose: { | 137 | onClose: { | ||
136 | if (notificationsModel.count > 1) { | 138 | if (listModel.count > 1) { | ||
137 | removeAnimation.running = true | 139 | removeAnimation.running = true | ||
138 | } else { | 140 | } else { | ||
139 | closeNotification(model.source) | 141 | closeNotification(model.source) | ||
140 | notificationsModel.remove(index) | 142 | listModel.remove(index) | ||
141 | } | 143 | } | ||
142 | } | 144 | } | ||
143 | onConfigure: { | 145 | onConfigure: { | ||
144 | plasmoid.expanded = false | 146 | plasmoid.expanded = false | ||
145 | configureNotification(model.appRealName, model.eventId) | 147 | configureNotification(model.appRealName, model.eventId) | ||
146 | } | 148 | } | ||
147 | onAction: { | 149 | onAction: { | ||
148 | executeAction(model.source, actionId) | 150 | executeAction(model.source, actionId) | ||
Show All 17 Lines |