@@ -57,10 +57,9 @@ Item {
5757 }
5858
5959 function showPrompt(text, isSecret, isDefaultPrompt) {
60− passwordInput.text = "";
61− passwordInput.promptText = text;
62− passwordInput.enabled = true;
63− passwordInput.echoMode = isSecret ? TextInput.Password : TextInput.Normal;
60+ d.promptText = text;
61+ passwordInput.reset();
62+ passwordInput.isSecret = isSecret;
6463 if (wasPrompted) // stay in text field if second prompt
6564 passwordInput.focus = true;
6665 wasPrompted = true;
@@ -78,6 +77,12 @@ Item {
7877 root.resetAuthentication();
7978 }
8079
80+ QtObject {
81+ id: d
82+
83+ property string promptText
84+ }
85+
8186 Keys.onEscapePressed: {
8287 selected(currentIndex);
8388 }
@@ -151,7 +156,7 @@ Item {
151156 return 1 - Math.min(1, (Math.abs(highlightDist) + root.cellHeight) / ((root.numAboveBelow + 1) * root.cellHeight))
152157 }
153158
154− Label {
159+ FadingLabel {
155160 objectName: "username" + index
156161
157162 anchors {
@@ -164,8 +169,7 @@ Item {
164169 topMargin: units.gu(1) + (parent.belowHighlight ? parent.belowOffset : 0)
165170 }
166171 text: realName
167− color: "white"
168− elide: Text.ElideRight
172+ color: UbuntuColors.porcelain
169173
170174 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
171175 }
@@ -208,7 +212,7 @@ Item {
208212 rightMargin: units.gu(1)
209213 }
210214
211− color: "white"
215+ color: UbuntuColors.porcelain
212216 width: root.width - anchors.leftMargin - anchors.rightMargin
213217 fontSize: "small"
214218 textFormat: Text.StyledText
@@ -220,7 +224,7 @@ Item {
220224 }
221225 }
222226
223− TextField {
227+ GreeterPrompt {
224228 id: passwordInput
225229 objectName: "passwordInput"
226230 anchors {
@@ -228,64 +232,28 @@ Item {
228232 horizontalCenter: parent.horizontalCenter
229233 margins: units.gu(1)
230234 }
231− height: units.gu(4.5)
232235 width: parent.width - anchors.margins * 2
233236 opacity: userList.movingInternally ? 0 : 1
234237
235− inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
238+ isPrompt: root.wasPrompted
239+ isAlphanumeric: root.alphanumeric
236240
237− property string promptText
238− placeholderText: root.wasPrompted ? promptText
239− : (root.locked ? i18n.tr("Retry")
240− : i18n.tr("Tap to unlock"))
241+ text: root.wasPrompted ? d.promptText
242+ : (root.locked ? i18n.tr("Retry")
243+ : i18n.tr("Log In"))
244+
245+ onClicked: root.tryToUnlock()
246+ onResponded: root.responded(text)
247+ onCanceled: root.selected(currentIndex)
241248
242249 Behavior on opacity {
243250 NumberAnimation { duration: 100 }
244251 }
245252
246− onAccepted: {
247− if (!enabled)
248− return;
249− root.focus = true; // so that it can handle Escape presses for us
250− enabled = false;
251− root.responded(text);
252− }
253− Keys.onEscapePressed: {
254− root.selected(currentIndex);
255− }
256−
257− Image {
258− anchors {
259− right: parent.right
260− rightMargin: units.gu(2)
261− verticalCenter: parent.verticalCenter
262− }
263− visible: !root.wasPrompted
264− source: "graphics/icon_arrow.png"
265− }
266−
267253 WrongPasswordAnimation {
268254 id: wrongPasswordAnimation
269255 target: passwordInput
270256 }
271−
272− Connections {
273− target: Qt.inputMethod
274− onVisibleChanged: {
275− if (!Qt.inputMethod.visible) {
276− passwordInput.focus = false;
277− }
278− }
279− }
280−
281− }
282−
283− MouseArea {
284− id: passwordMouseArea
285− objectName: "passwordMouseArea"
286− anchors.fill: passwordInput
287− enabled: !root.wasPrompted
288− onClicked: root.tryToUnlock()
289257 }
290258
291259 function resetAuthentication() {
@@ -293,10 +261,8 @@ Item {
293261 return;
294262 }
295263 infoLabel.text = "";
296− passwordInput.promptText = "";
297− passwordInput.text = "";
298− passwordInput.focus = false;
299− passwordInput.enabled = true;
264+ d.promptText = "";
265+ passwordInput.reset();
300266 root.wasPrompted = false;
301267 }
302268}