on xenial help sign in
Fix Lockscreen background and add test
commit3769f12eb097b078f3372046b6060b3f9296d487 authorAndrea Cimitan <andrea.cimitan@gmail.com> dateFri 25 Oct 2013, 13:59 (13 years ago) parentbd18e2b
3 files changed+17−1
Greeter/Lockscreen.qml+5−1 Shell.qml+4 tests/qmltests/tst_Shell.qml+8
Greeter/Lockscreen.qml+5−1
@@ -62,7 +62,11 @@ Showable {
6262
6363 Image {
6464 id: backgroundImage
65− anchors.fill: parent
65+ objectName: "lockscreenBackground"
66+ anchors {
67+ fill: parent
68+ topMargin: backgroundTopMargin
69+ }
6670 source: root.required ? root.background : ""
6771 fillMode: Image.PreserveAspectCrop
6872 }
Shell.qml+4
@@ -402,6 +402,10 @@ FocusScope {
402402
403403 Lockscreen {
404404 id: lockscreen
405+ objectName: "lockscreen"
406+
407+ readonly property int backgroundTopMargin: -panel.panelHeight
408+
405409 hides: [launcher, panel.indicators, hud]
406410 shown: false
407411 enabled: true
tests/qmltests/tst_Shell.qml+8
@@ -448,6 +448,14 @@ Item {
448448 tryCompare(backgroundImage, "status", Image.Ready)
449449 }
450450
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+
451459 function test_DashShown_data() {
452460 return [
453461 {tag: "in focus", greeter: false, app: false, launcher: false, indicators: false, expectedShown: true},