on xenial help sign in
fix the broken binding (reaching out of context)
16922ceLukáš Tinkl
qml/Notifications/Notification.qml+2−1
@@ -41,11 +41,12 @@ StyledItem {
41 property int maxHeight
41 property int maxHeight
42 property int margins
42 property int margins
43 readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") || type === Notification.Interactive || type === Notification.Ephemeral
43 readonly property bool draggable: (type === Notification.SnapDecision && state === "contracted") || type === Notification.Interactive || type === Notification.Ephemeral
44− readonly property bool darkOnBright: panel.indicators.shown || type === Notification.SnapDecision
44+ readonly property bool darkOnBright: inverseMode || type === Notification.SnapDecision
45 readonly property color sdLightGrey: "#eaeaea"
45 readonly property color sdLightGrey: "#eaeaea"
46 readonly property real contentSpacing: units.gu(2)
46 readonly property real contentSpacing: units.gu(2)
47 readonly property bool canBeClosed: type === Notification.Ephemeral
47 readonly property bool canBeClosed: type === Notification.Ephemeral
48 property bool hasMouse
48 property bool hasMouse
49+ property bool inverseMode
49 property url background: ""
50 property url background: ""
50
51
51 objectName: "background"
52 objectName: "background"
qml/Notifications/Notifications.qml+2
@@ -29,6 +29,7 @@ ListView {
29 property real margin
29 property real margin
30 property bool useModal: snapDecisionProxyModel.count > 0
30 property bool useModal: snapDecisionProxyModel.count > 0
31 property bool hasMouse
31 property bool hasMouse
32+ property bool inverseMode
32 property url background: ""
33 property url background: ""
33
34
34 UnitySortFilterProxyModel {
35 UnitySortFilterProxyModel {
@@ -61,6 +62,7 @@ ListView {
61 maxHeight: notificationList.height
62 maxHeight: notificationList.height
62 margins: notificationList.margin
63 margins: notificationList.margin
63 hasMouse: notificationList.hasMouse
64 hasMouse: notificationList.hasMouse
65+ inverseMode: notificationList.inverseMode
64 background: notificationList.background
66 background: notificationList.background
65
67
66 // make sure there's no opacity-difference between the several
68 // make sure there's no opacity-difference between the several
qml/Shell.qml+1
@@ -663,6 +663,7 @@ Item {
663 model: NotificationBackend.Model
663 model: NotificationBackend.Model
664 margin: units.gu(1)
664 margin: units.gu(1)
665 hasMouse: shell.hasMouse
665 hasMouse: shell.hasMouse
666+ inverseMode: panel.indicators.shown
666 background: wallpaperResolver.background
667 background: wallpaperResolver.background
667
668
668 y: topmostIsFullscreen ? 0 : panel.panelHeight
669 y: topmostIsFullscreen ? 0 : panel.panelHeight
tests/qmltests/Notifications/tst_Notifications.qml+13−8
@@ -187,7 +187,8 @@ Item {
187
187
188 anchors.fill: parent
188 anchors.fill: parent
189 model: mockModel
189 model: mockModel
190− hasMouse: false
190+ hasMouse: fakeMouseCB.checked
191+ inverseMode: inverseModeCB.checked
191 }
192 }
192 }
193 }
193
194
@@ -261,19 +262,23 @@ Item {
261 Layout.fillWidth: true
262 Layout.fillWidth: true
262 CheckBox {
263 CheckBox {
263 id: fakeMouseCB
264 id: fakeMouseCB
264− onClicked: {
265− if (checked) {
266− notifications.hasMouse = true;
267− } else {
268− notifications.hasMouse = false;
269− }
270− }
271 }
265 }
272 Label {
266 Label {
273 text: "With fake mouse"
267 text: "With fake mouse"
274 anchors.verticalCenter: parent.verticalCenter
268 anchors.verticalCenter: parent.verticalCenter
275 }
269 }
276 }
270 }
271+
272+ RowLayout {
273+ Layout.fillWidth: true
274+ CheckBox {
275+ id: inverseModeCB
276+ }
277+ Label {
278+ text: "Inverse mode"
279+ anchors.verticalCenter: parent.verticalCenter
280+ }
281+ }
277 }
282 }
278 }
283 }
279
284