on xenial help sign in
Fix Greeter Wallpaper being positioned differently
c3211f7Dalton Durst
qml/Greeter/CoverPage.qml+5−4
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.
2 * Copyright (C) 2013-2016 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -26,7 +27,7 @@ Showable {
26 property real launcherOffset
27 property real launcherOffset
27 property alias background: greeterBackground.source
28 property alias background: greeterBackground.source
28 property alias hasCustomBackground: backgroundShade.visible
29 property alias hasCustomBackground: backgroundShade.visible
29− property real backgroundTopMargin
30+ property real panelHeight
30 property var infographicModel
31 property var infographicModel
31 property bool draggable: true
32 property bool draggable: true
32
33
@@ -88,7 +89,6 @@ Showable {
88 objectName: "greeterBackground"
89 objectName: "greeterBackground"
89 anchors {
90 anchors {
90 fill: parent
91 fill: parent
91− topMargin: root.backgroundTopMargin
92 }
92 }
93 }
93 }
94
94
@@ -105,12 +105,13 @@ Showable {
105 Infographics {
105 Infographics {
106 id: infographics
106 id: infographics
107 objectName: "infographics"
107 objectName: "infographics"
108− height: parent.height
109 model: root.infographicModel
108 model: root.infographicModel
110 clip: true // clip large data bubbles
109 clip: true // clip large data bubbles
111
110
112 anchors {
111 anchors {
113− verticalCenter: parent.verticalCenter
112+ topMargin: root.panelHeight
113+ top: parent.top
114+ bottom: parent.bottom
114 left: parent.left
115 left: parent.left
115 right: parent.right
116 right: parent.right
116 }
117 }
qml/Greeter/Greeter.qml+6−2
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.
2 * Copyright (C) 2013-2016 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -38,6 +39,9 @@ Showable {
38 // How far to offset the top greeter layer during a launcher left-drag
39 // How far to offset the top greeter layer during a launcher left-drag
39 property real launcherOffset
40 property real launcherOffset
40
41
42+ // How far down to position the greeter's interface to avoid the Panel
43+ property real panelHeight
44+
41 readonly property bool active: required || hasLockedApp
45 readonly property bool active: required || hasLockedApp
42 readonly property bool fullyShown: loader.item ? loader.item.fullyShown : false
46 readonly property bool fullyShown: loader.item ? loader.item.fullyShown : false
43
47
@@ -380,8 +384,8 @@ Showable {
380
384
381 Binding {
385 Binding {
382 target: loader.item
386 target: loader.item
383− property: "backgroundTopMargin"
387+ property: "panelHeight"
384− value: -root.y
388+ value: root.panelHeight
385 }
389 }
386
390
387 Binding {
391 Binding {
qml/Greeter/NarrowView.qml+4−3
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2015-2016 Canonical, Ltd.
2 * Copyright (C) 2015-2016 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -27,7 +28,7 @@ FocusScope {
27 property alias launcherOffset: coverPage.launcherOffset
28 property alias launcherOffset: coverPage.launcherOffset
28 property alias currentIndex: loginList.currentIndex
29 property alias currentIndex: loginList.currentIndex
29 property alias delayMinutes: delayedLockscreen.delayMinutes
30 property alias delayMinutes: delayedLockscreen.delayMinutes
30− property alias backgroundTopMargin: coverPage.backgroundTopMargin
31+ property real panelHeight
31 property url background
32 property url background
32 property bool hasCustomBackground
33 property bool hasCustomBackground
33 property bool locked
34 property bool locked
@@ -110,7 +111,6 @@ FocusScope {
110 objectName: "lockscreenBackground"
111 objectName: "lockscreenBackground"
111 anchors {
112 anchors {
112 fill: parent
113 fill: parent
113− topMargin: root.backgroundTopMargin
114 }
114 }
115 source: root.background
115 source: root.background
116 }
116 }
@@ -171,6 +171,7 @@ FocusScope {
171 width: parent.width
171 width: parent.width
172 background: root.background
172 background: root.background
173 hasCustomBackground: root.hasCustomBackground
173 hasCustomBackground: root.hasCustomBackground
174+ panelHeight: root.panelHeight
174 draggable: !root.waiting
175 draggable: !root.waiting
175 onTease: root.tease()
176 onTease: root.tease()
176 onClicked: hide()
177 onClicked: hide()
@@ -188,7 +189,7 @@ FocusScope {
188 Clock {
189 Clock {
189 anchors {
190 anchors {
190 top: parent.top
191 top: parent.top
191− topMargin: units.gu(2)
192+ topMargin: units.gu(2) + panelHeight
192 horizontalCenter: parent.horizontalCenter
193 horizontalCenter: parent.horizontalCenter
193 }
194 }
194 }
195 }
qml/Greeter/WideView.qml+4−2
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2015-2016 Canonical, Ltd.
2 * Copyright (C) 2015-2016 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -25,7 +26,7 @@ FocusScope {
25 focus: true
26 focus: true
26
27
27 property alias background: coverPage.background
28 property alias background: coverPage.background
28− property alias backgroundTopMargin: coverPage.backgroundTopMargin
29+ property alias panelHeight: coverPage.panelHeight
29 property alias hasCustomBackground: coverPage.hasCustomBackground
30 property alias hasCustomBackground: coverPage.hasCustomBackground
30 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
31 property alias dragHandleLeftMargin: coverPage.dragHandleLeftMargin
31 property alias infographicModel: coverPage.infographicModel
32 property alias infographicModel: coverPage.infographicModel
@@ -97,7 +98,8 @@ FocusScope {
97 state: "LoginList"
98 state: "LoginList"
98
99
99 infographics {
100 infographics {
101+ anchors.topMargin: parent.height * 0.125
100− height: 0.75 * parent.height
102+ anchors.bottomMargin: parent.height * 0.125
101 anchors.leftMargin: loginList.x + loginList.width
103 anchors.leftMargin: loginList.x + loginList.width
102 }
104 }
103
105
qml/Shell.qml+2−2
@@ -1,6 +1,6 @@
1/*
1/*
2 * Copyright (C) 2013-2016 Canonical, Ltd.
2 * Copyright (C) 2013-2016 Canonical, Ltd.
3− * Copyright (C) 2019-2020 UBports Foundation
3+ * Copyright (C) 2019-2021 UBports Foundation
4 *
4 *
5 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -391,7 +391,6 @@ StyledItem {
391 id: greeterLoader
391 id: greeterLoader
392 objectName: "greeterLoader"
392 objectName: "greeterLoader"
393 anchors.fill: parent
393 anchors.fill: parent
394− anchors.topMargin: panel.panelHeight
395 sourceComponent: shell.mode != "shell" ? integratedGreeter :
394 sourceComponent: shell.mode != "shell" ? integratedGreeter :
396 Qt.createComponent(Qt.resolvedUrl("Greeter/ShimGreeter.qml"));
395 Qt.createComponent(Qt.resolvedUrl("Greeter/ShimGreeter.qml"));
397 onLoaded: {
396 onLoaded: {
@@ -428,6 +427,7 @@ StyledItem {
428 allowFingerprint: !dialogs.hasActiveDialog &&
427 allowFingerprint: !dialogs.hasActiveDialog &&
429 !notifications.topmostIsFullscreen &&
428 !notifications.topmostIsFullscreen &&
430 !panel.indicators.shown
429 !panel.indicators.shown
430+ panelHeight: panel.panelHeight
431
431
432 // avoid overlapping with Launcher's edge drag area
432 // avoid overlapping with Launcher's edge drag area
433 // FIXME: Fix TouchRegistry & friends and remove this workaround
433 // FIXME: Fix TouchRegistry & friends and remove this workaround
tests/qmltests/Greeter/TestView.qml+2−1
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright (C) 2015 Canonical, Ltd.
2 * Copyright (C) 2015 Canonical, Ltd.
3+ * Copyright (C) 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -25,7 +26,7 @@ Item {
25 property real launcherOffset
26 property real launcherOffset
26 property int currentIndex
27 property int currentIndex
27 property int delayMinutes
28 property int delayMinutes
28− property real backgroundTopMargin
29+ property real panelHeight
29 property url background
30 property url background
30 property bool hasCustomBackground
31 property bool hasCustomBackground
31 property bool locked
32 property bool locked
tests/qmltests/Greeter/tst_Greeter.qml−6
@@ -359,12 +359,6 @@ Item {
359 }
359 }
360 }
360 }
361
361
362− function test_backgroundTopMargin() {
363− compare(view.backgroundTopMargin, 0);
364− greeter.y = 5;
365− compare(view.backgroundTopMargin, -5);
366− }
367−
368 function test_authError() {
362 function test_authError() {
369 selectUser("auth-error");
363 selectUser("auth-error");
370 tryCompare(viewAuthenticationFailedSpy, "count", 1);
364 tryCompare(viewAuthenticationFailedSpy, "count", 1);
tests/qmltests/Greeter/tst_NarrowView.qml+4−3
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright 2014 Canonical Ltd.
2 * Copyright 2014 Canonical Ltd.
3+ * Copyright 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -54,7 +55,7 @@ Item {
54 launcherOffset: parseFloat(launcherOffsetField.text)
55 launcherOffset: parseFloat(launcherOffsetField.text)
55 currentIndex: parseInt(currentIndexField.text, 10)
56 currentIndex: parseInt(currentIndexField.text, 10)
56 delayMinutes: parseInt(delayMinutesField.text, 10)
57 delayMinutes: parseInt(delayMinutesField.text, 10)
57− backgroundTopMargin: parseFloat(backgroundTopMarginField.text)
58+ panelHeight: parseFloat(panelHeightField.text)
58 locked: lockedCheckBox.checked
59 locked: lockedCheckBox.checked
59 alphanumeric: alphanumericCheckBox.checked
60 alphanumeric: alphanumericCheckBox.checked
60
61
@@ -165,12 +166,12 @@ Item {
165 }
166 }
166 Row {
167 Row {
167 TextField {
168 TextField {
168− id: backgroundTopMarginField
169+ id: panelHeightField
169 width: units.gu(10)
170 width: units.gu(10)
170 text: "0"
171 text: "0"
171 }
172 }
172 Label {
173 Label {
173− text: "backgroundTopMargin"
174+ text: "panelHeight"
174 }
175 }
175 }
176 }
176 Row {
177 Row {
tests/qmltests/Greeter/tst_WideView.qml+4−3
@@ -1,5 +1,6 @@
1/*
1/*
2 * Copyright 2014-2016 Canonical Ltd.
2 * Copyright 2014-2016 Canonical Ltd.
3+ * Copyright 2021 UBports Foundation
3 *
4 *
4 * This program is free software; you can redistribute it and/or modify
5 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * it under the terms of the GNU General Public License as published by
@@ -52,7 +53,7 @@ StyledItem {
52 launcherOffset: parseFloat(launcherOffsetField.text)
53 launcherOffset: parseFloat(launcherOffsetField.text)
53 currentIndex: parseInt(currentIndexField.text, 10)
54 currentIndex: parseInt(currentIndexField.text, 10)
54 delayMinutes: parseInt(delayMinutesField.text, 10)
55 delayMinutes: parseInt(delayMinutesField.text, 10)
55− backgroundTopMargin: parseFloat(backgroundTopMarginField.text)
56+ panelHeight: parseFloat(panelHeightField.text)
56 locked: lockedCheckBox.checked
57 locked: lockedCheckBox.checked
57 inputMethod: fakeInputMethod
58 inputMethod: fakeInputMethod
58
59
@@ -196,12 +197,12 @@ StyledItem {
196 }
197 }
197 Row {
198 Row {
198 TextField {
199 TextField {
199− id: backgroundTopMarginField
200+ id: panelHeightField
200 width: units.gu(10)
201 width: units.gu(10)
201 text: "0"
202 text: "0"
202 }
203 }
203 Label {
204 Label {
204− text: "backgroundTopMargin"
205+ text: "panelHeight"
205 }
206 }
206 }
207 }
207 Row {
208 Row {