on xenial help sign in
Work around greeter anchoring mess (#190)
35dc0edJan Sprinz
qml/Greeter/GreeterPrompt.qml+8−6
@@ -214,14 +214,15 @@ FocusScope {
214 id: hint
214 id: hint
215 objectName: "promptHint"
215 objectName: "promptHint"
216 anchors {
216 anchors {
217− left: parent.left
217+ left: parent ? parent.left : undefined
218− right: parent.right
218+ right: parent ? parent.right : undefined
219− verticalCenter: parent.verticalCenter
219+ verticalCenter: parent ? parent.verticalCenter : undefined
220 leftMargin: units.gu(1.5)
220 leftMargin: units.gu(1.5)
221 rightMargin: anchors.leftMargin + extraIcons.width
221 rightMargin: anchors.leftMargin + extraIcons.width
222 }
222 }
223 text: root.text
223 text: root.text
224 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
224 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
225+ enabled: visible
225 color: d.drawColor
226 color: d.drawColor
226 elide: Text.ElideRight
227 elide: Text.ElideRight
227 }
228 }
@@ -236,13 +237,14 @@ FocusScope {
236 // we'll fake it by covering the real text field with a label.
237 // we'll fake it by covering the real text field with a label.
237 FadingLabel {
238 FadingLabel {
238 id: fakeLabel
239 id: fakeLabel
239− anchors.verticalCenter: parent.verticalCenter
240+ anchors.verticalCenter: parent ? parent.verticalCenter : undefined
240− anchors.left: parent.left
241+ anchors.left: parent ? parent.left : undefined
241− anchors.right: parent.right
242+ anchors.right: parent ? parent.right : undefined
242 anchors.leftMargin: passwordInput.frameSpacing * 2
243 anchors.leftMargin: passwordInput.frameSpacing * 2
243 anchors.rightMargin: passwordInput.frameSpacing * 2 + extraIcons.width
244 anchors.rightMargin: passwordInput.frameSpacing * 2 + extraIcons.width
244 color: d.drawColor
245 color: d.drawColor
245 text: passwordInput.displayText
246 text: passwordInput.displayText
246 visible: root.isPrompt && !root.interactive
247 visible: root.isPrompt && !root.interactive
248+ enabled: visible
247 }
249 }
248}
250}
qml/Greeter/LoginList.qml+16
@@ -30,6 +30,7 @@ StyledItem {
30 property bool locked
30 property bool locked
31 property bool waiting
31 property bool waiting
32 property alias boxVerticalOffset: highlightItem.y
32 property alias boxVerticalOffset: highlightItem.y
33+ property string _realName
33
34
34 readonly property int numAboveBelow: 4
35 readonly property int numAboveBelow: 4
35 readonly property int cellHeight: units.gu(5)
36 readonly property int cellHeight: units.gu(5)
@@ -92,6 +93,18 @@ StyledItem {
92
93
93 height: Math.max(units.gu(15), promptList.height + units.gu(8))
94 height: Math.max(units.gu(15), promptList.height + units.gu(8))
94 Behavior on height { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
95 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+ }
95 }
108 }
96
109
97 ListView {
110 ListView {
@@ -143,6 +156,7 @@ StyledItem {
143
156
144 FadingLabel {
157 FadingLabel {
145 objectName: "username" + index
158 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
146
160
147 anchors {
161 anchors {
148 left: parent.left
162 left: parent.left
@@ -160,6 +174,8 @@ StyledItem {
160 color: userList.currentIndex !== index ? theme.palette.normal.raised
174 color: userList.currentIndex !== index ? theme.palette.normal.raised
161 : theme.palette.normal.raisedText
175 : theme.palette.normal.raisedText
162
176
177+ Component.onCompleted: _realName = realName
178+
163 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
179 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
164
180
165 Rectangle {
181 Rectangle {