on xenial help sign in
Work around greeter anchoring mess (#190)

This hides the user manager to work around #185. Instead, it will display a new label that's properly anchored. Yes. I know: It's not pretty. But there's a lot of unused complexity here that we might need later. I don't want to touch all that now, but i am also convinced that we need to fix this. Every person i give my M10 to notices this, and that is not the first impression i want people to get of Ubuntu Touch. At some point we will have to refactor this and fix it properly.

commit35dc0ed7f7f54d756a75c32450288f70c79b9822 authorJan Sprinz <NeoTheThird@users.noreply.github.com> dateWed 18 Sep 2019, 21:36 (7 years ago) parent929e41e
2 files changed+24−6
qml/Greeter/GreeterPrompt.qml+8−6 qml/Greeter/LoginList.qml+16
qml/Greeter/GreeterPrompt.qml+8−6
@@ -214,14 +214,15 @@ FocusScope {
214214 id: hint
215215 objectName: "promptHint"
216216 anchors {
217− left: parent.left
218− right: parent.right
219− verticalCenter: parent.verticalCenter
217+ left: parent ? parent.left : undefined
218+ right: parent ? parent.right : undefined
219+ verticalCenter: parent ? parent.verticalCenter : undefined
220220 leftMargin: units.gu(1.5)
221221 rightMargin: anchors.leftMargin + extraIcons.width
222222 }
223223 text: root.text
224224 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
225+ enabled: visible
225226 color: d.drawColor
226227 elide: Text.ElideRight
227228 }
@@ -236,13 +237,14 @@ FocusScope {
236237 // we'll fake it by covering the real text field with a label.
237238 FadingLabel {
238239 id: fakeLabel
239− anchors.verticalCenter: parent.verticalCenter
240− anchors.left: parent.left
241− anchors.right: parent.right
240+ anchors.verticalCenter: parent ? parent.verticalCenter : undefined
241+ anchors.left: parent ? parent.left : undefined
242+ anchors.right: parent ? parent.right : undefined
242243 anchors.leftMargin: passwordInput.frameSpacing * 2
243244 anchors.rightMargin: passwordInput.frameSpacing * 2 + extraIcons.width
244245 color: d.drawColor
245246 text: passwordInput.displayText
246247 visible: root.isPrompt && !root.interactive
248+ enabled: visible
247249 }
248250}
qml/Greeter/LoginList.qml+16
@@ -30,6 +30,7 @@ StyledItem {
3030 property bool locked
3131 property bool waiting
3232 property alias boxVerticalOffset: highlightItem.y
33+ property string _realName
3334
3435 readonly property int numAboveBelow: 4
3536 readonly property int cellHeight: units.gu(5)
@@ -92,6 +93,18 @@ StyledItem {
9293
9394 height: Math.max(units.gu(15), promptList.height + units.gu(8))
9495 Behavior on height { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
96+
97+ Label {
98+ // HACK: Work around https://github.com/ubports/unity8/issues/185
99+ text: _realName ? _realName : LightDMService.greeter.authenticationUser
100+ visible: userList.count == 1
101+ anchors {
102+ left: parent.left
103+ top: parent.top
104+ topMargin: units.gu(2)
105+ leftMargin: units.gu(2)
106+ }
107+ }
95108 }
96109
97110 ListView {
@@ -143,6 +156,7 @@ StyledItem {
143156
144157 FadingLabel {
145158 objectName: "username" + index
159+ visible: userList.count != 1 // HACK Hide username label until someone sorts out the anchoring with the keyboard-dismiss animation, Work around https://github.com/ubports/unity8/issues/185
146160
147161 anchors {
148162 left: parent.left
@@ -160,6 +174,8 @@ StyledItem {
160174 color: userList.currentIndex !== index ? theme.palette.normal.raised
161175 : theme.palette.normal.raisedText
162176
177+ Component.onCompleted: _realName = realName
178+
163179 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
164180
165181 Rectangle {