on xenial help sign in
fix the topMargin + test
d5d401dLukáš Tinkl
qml/Notifications/Notification.qml+3−1
@@ -48,7 +48,7 @@ StyledItem {
48 property url background: ""
48 property url background: ""
49
49
50 objectName: "background"
50 objectName: "background"
51− implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height + 2* margins) : 0
51+ implicitHeight: type !== Notification.PlaceHolder ? (fullscreen ? maxHeight : outterColumn.height + shapedBack.anchors.topMargin + margins * 2) : 0
52
52
53 // FIXME: non-zero initially because of LP: #1354406 workaround, we want this to start at 0 upon creation eventually
53 // FIXME: non-zero initially because of LP: #1354406 workaround, we want this to start at 0 upon creation eventually
54 opacity: defaultOpacity - Math.abs(x / notification.width)
54 opacity: defaultOpacity - Math.abs(x / notification.width)
@@ -131,12 +131,14 @@ StyledItem {
131
131
132 UbuntuShape {
132 UbuntuShape {
133 id: shapedBack
133 id: shapedBack
134+ objectName: "shapedBack"
134
135
135 visible: !fullscreen
136 visible: !fullscreen
136 anchors {
137 anchors {
137 fill: parent
138 fill: parent
138 leftMargin: notification.margins
139 leftMargin: notification.margins
139 rightMargin: notification.margins
140 rightMargin: notification.margins
141+ topMargin: index == 0 ? notification.margins : 0
140 }
142 }
141 backgroundColor: parent.color
143 backgroundColor: parent.color
142 radius: "small"
144 radius: "small"
tests/qmltests/Notifications/tst_Notifications.qml+2−1
@@ -619,7 +619,8 @@ Item {
619 var n = findChild(notifications, "notification" + i)
619 var n = findChild(notifications, "notification" + i)
620 waitForRendering(n);
620 waitForRendering(n);
621 var outterColumn = findChild(n, "outterColumn");
621 var outterColumn = findChild(n, "outterColumn");
622+ var shapedBack = findChild(n, "shapedBack");
622− tryCompare(n, "height", outterColumn.height + n.margins * 2);
623+ tryCompare(n, "height", outterColumn.height + n.margins * 2 + shapedBack.anchors.topMargin);
623 }
624 }
624
625
625 if (data.hasSound) {
626 if (data.hasSound) {