2 * Copyright (C) 2013-2016 Canonical Ltd.
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.
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.
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/>.
18import Lomiri.Components 1.3
19import Lomiri.Notifications 1.0 as LomiriNotifications
26 objectName: "notificationList"
29 readonly property bool hasNotification: count > 0
31 property bool hasMouse
32 property url background: ""
33 property bool privacyMode: false
35 readonly property bool useModal: snapDecisionProxyModel.count > 0
37 LomiriSortFilterProxyModel {
38 id: snapDecisionProxyModel
39 objectName: "snapDecisionProxyModel"
41 model: notificationList.model ? notificationList.model : null
42 filterRole: LomiriNotifications.ModelInterface != undefined ? LomiriNotifications.ModelInterface.RoleType : 0
43 filterRegExp: RegExp(LomiriNotifications.Notification.SnapDecision)
46 property bool topmostIsFullscreen: false
47 spacing: topmostIsFullscreen ? 0 : units.gu(1)
51 delegate: Notification {
52 objectName: "notification" + index
56 iconSource: model.icon
57 privacyMode: notificationList.privacyMode
58 secondaryIconSource: model.secondaryIcon ? model.secondaryIcon : ""
59 summary: model.summary
61 value: model.value ? model.value : -1
62 actions: model.actions
63 notificationId: model.id
64 notification: notificationList.model.getRaw(notificationId)
65 maxHeight: notificationList.height
66 margins: notificationList.margin
67 hasMouse: notificationList.hasMouse
68 background: notificationList.background
70 Component.onCompleted: topmostIsFullscreen = false; // async, the factory loader will set fullscreen to true later
72 property int theIndex: index
75 ListView.view.topmostIsFullscreen = fullscreen; // when we get pushed down by e.g. volume notification
79 // make sure there's no opacity-difference between the several
80 // elements in a notification
81 // FIXME: disabled all transitions because of LP: #1354406 workaround
82 //layer.enabled: add.running || remove.running || populate.running
85 onCountChanged: if (count == 0) topmostIsFullscreen = false; // reset
87 // FIXME: disabled all transitions because of LP: #1354406 workaround
88 /*populate: Transition {
89 LomiriNumberAnimation {
92 duration: LomiriAnimation.SnapDuration
97 LomiriNumberAnimation {
100 duration: LomiriAnimation.SnapDuration
105 LomiriNumberAnimation {
111 displaced: Transition {
112 LomiriNumberAnimation {
114 duration: LomiriAnimation.SnapDuration