on xenial help sign in
Fix Lockscreen background and add test
3769f12Andrea Cimitan
Greeter/Lockscreen.qml+5−1
@@ -62,7 +62,11 @@ Showable {
62
62
63 Image {
63 Image {
64 id: backgroundImage
64 id: backgroundImage
65+ objectName: "lockscreenBackground"
66+ anchors {
65− anchors.fill: parent
67+ fill: parent
68+ topMargin: backgroundTopMargin
69+ }
66 source: root.required ? root.background : ""
70 source: root.required ? root.background : ""
67 fillMode: Image.PreserveAspectCrop
71 fillMode: Image.PreserveAspectCrop
68 }
72 }
Shell.qml+4
@@ -402,6 +402,10 @@ FocusScope {
402
402
403 Lockscreen {
403 Lockscreen {
404 id: lockscreen
404 id: lockscreen
405+ objectName: "lockscreen"
406+
407+ readonly property int backgroundTopMargin: -panel.panelHeight
408+
405 hides: [launcher, panel.indicators, hud]
409 hides: [launcher, panel.indicators, hud]
406 shown: false
410 shown: false
407 enabled: true
411 enabled: true
tests/qmltests/tst_Shell.qml+8
@@ -448,6 +448,14 @@ Item {
448 tryCompare(backgroundImage, "status", Image.Ready)
448 tryCompare(backgroundImage, "status", Image.Ready)
449 }
449 }
450
450
451+ function test_lockscreen_background() {
452+ var backgroundImage = findChild(shell, "backgroundImage")
453+ var lockscreen = findChild(shell, "lockscreen")
454+ var lockscreenBackground = findChild(lockscreen, "lockscreenBackground")
455+ var lockscreenBackgroundMapped = lockscreenBackground.mapToItem(shell, 0, 0)
456+ compare(backgroundImage.y, lockscreenBackgroundMapped.y)
457+ }
458+
451 function test_DashShown_data() {
459 function test_DashShown_data() {
452 return [
460 return [
453 {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},
461 {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},