on xenial help sign in
fix the topMargin + test
commitd5d401de30a7c441e416c4651a95ca25038babdd authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 8 Apr 2016, 00:36 (11 years ago) parenta31b60f
2 files changed+5−2
qml/Notifications/Notification.qml+3−1 tests/qmltests/Notifications/tst_Notifications.qml+2−1
qml/Notifications/Notification.qml+3−1
@@ -48,7 +48,7 @@ StyledItem {
4848 property url background: ""
4949
5050 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
5252
5353 // FIXME: non-zero initially because of LP: #1354406 workaround, we want this to start at 0 upon creation eventually
5454 opacity: defaultOpacity - Math.abs(x / notification.width)
@@ -131,12 +131,14 @@ StyledItem {
131131
132132 UbuntuShape {
133133 id: shapedBack
134+ objectName: "shapedBack"
134135
135136 visible: !fullscreen
136137 anchors {
137138 fill: parent
138139 leftMargin: notification.margins
139140 rightMargin: notification.margins
141+ topMargin: index == 0 ? notification.margins : 0
140142 }
141143 backgroundColor: parent.color
142144 radius: "small"
tests/qmltests/Notifications/tst_Notifications.qml+2−1
@@ -619,7 +619,8 @@ Item {
619619 var n = findChild(notifications, "notification" + i)
620620 waitForRendering(n);
621621 var outterColumn = findChild(n, "outterColumn");
622− tryCompare(n, "height", outterColumn.height + n.margins * 2);
622+ var shapedBack = findChild(n, "shapedBack");
623+ tryCompare(n, "height", outterColumn.height + n.margins * 2 + shapedBack.anchors.topMargin);
623624 }
624625
625626 if (data.hasSound) {