on xenial help sign in
fix the broken binding (reaching out of context)

for inverseMode and make it propertly exported, so that it can be tested

commit16922ce5e92e163d2d86d9fcfcf0a6687830be39 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateTue 15 Mar 2016, 21:17 (11 years ago) parent7ddb3c7
4 files changed+18−9
qml/Notifications/Notification.qml+2−1 qml/Notifications/Notifications.qml+2 qml/Shell.qml+1 tests/qmltests/Notifications/tst_Notifications.qml+13−8
qml/Notifications/Notification.qml+2−1
@@ -41,11 +41,12 @@ StyledItem {
4141 property int maxHeight
4242 property int margins
4343 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
4545 readonly property color sdLightGrey: "#eaeaea"
4646 readonly property real contentSpacing: units.gu(2)
4747 readonly property bool canBeClosed: type === Notification.Ephemeral
4848 property bool hasMouse
49+ property bool inverseMode
4950 property url background: ""
5051
5152 objectName: "background"
qml/Notifications/Notifications.qml+2
@@ -29,6 +29,7 @@ ListView {
2929 property real margin
3030 property bool useModal: snapDecisionProxyModel.count > 0
3131 property bool hasMouse
32+ property bool inverseMode
3233 property url background: ""
3334
3435 UnitySortFilterProxyModel {
@@ -61,6 +62,7 @@ ListView {
6162 maxHeight: notificationList.height
6263 margins: notificationList.margin
6364 hasMouse: notificationList.hasMouse
65+ inverseMode: notificationList.inverseMode
6466 background: notificationList.background
6567
6668 // make sure there's no opacity-difference between the several
qml/Shell.qml+1
@@ -663,6 +663,7 @@ Item {
663663 model: NotificationBackend.Model
664664 margin: units.gu(1)
665665 hasMouse: shell.hasMouse
666+ inverseMode: panel.indicators.shown
666667 background: wallpaperResolver.background
667668
668669 y: topmostIsFullscreen ? 0 : panel.panelHeight
tests/qmltests/Notifications/tst_Notifications.qml+13−8
@@ -187,7 +187,8 @@ Item {
187187
188188 anchors.fill: parent
189189 model: mockModel
190− hasMouse: false
190+ hasMouse: fakeMouseCB.checked
191+ inverseMode: inverseModeCB.checked
191192 }
192193 }
193194
@@ -261,19 +262,23 @@ Item {
261262 Layout.fillWidth: true
262263 CheckBox {
263264 id: fakeMouseCB
264− onClicked: {
265− if (checked) {
266− notifications.hasMouse = true;
267− } else {
268− notifications.hasMouse = false;
269− }
270− }
271265 }
272266 Label {
273267 text: "With fake mouse"
274268 anchors.verticalCenter: parent.verticalCenter
275269 }
276270 }
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+ }
277282 }
278283 }
279284