on xenial help sign in
Restrict use of modal tinted background to snap-decision notifications.
commit4e20d86930ae2051714a838acf870fd7f5747259 authorMirco Müller <mirco.mueller@canonical.com> dateThu 13 Mar 2014, 11:12 (13 years ago) parentac43dfe
2 files changed+15−13
qml/Notifications/Notification.qml+12 qml/Notifications/Notifications.qml+3−13
qml/Notifications/Notification.qml+12
@@ -37,6 +37,18 @@ Item {
3737 property int maxHeight
3838 property int margins
3939
40+ Component.onCompleted: {
41+ if (type == Notification.SnapDecision) {
42+ notificationList.snapDecisionCount++;
43+ }
44+ }
45+
46+ Component.onDestruction: {
47+ if (type == Notification.SnapDecision) {
48+ notificationList.snapDecisionCount--;
49+ }
50+ }
51+
4052 fullscreen: false
4153 objectName: "background"
4254 implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : contentColumn.height + contentColumn.spacing * 4) : 0
qml/Notifications/Notifications.qml+3−13
@@ -26,8 +26,10 @@ ListView {
2626
2727 property real margin
2828 property bool useModal
29+ property int snapDecisionCount
2930
30− useModal: false
31+ snapDecisionCount: 0
32+ useModal: snapDecisionCount > 0
3133
3234 delegate: Notification {
3335 objectName: "notification" + index
@@ -47,18 +49,6 @@ ListView {
4749 maxHeight: notificationList.height
4850 margins: notificationList.margin
4951
50− ListView.onAdd: {
51− if (notificationList.count > 1) {
52− notificationList.useModal = true;
53− }
54− }
55−
56− ListView.onRemove: {
57− if (notificationList.count <= 1) {
58− notificationList.useModal = false;
59− }
60− }
61−
6252 // make sure there's no opacity-difference between the several
6353 // elements in a notification
6454 layer.enabled: add.running || remove.running || populate.running