@@ -57,10 +57,9 @@ Item {
59 function showPrompt(text, isSecret, isDefaultPrompt) {
59 function showPrompt(text, isSecret, isDefaultPrompt) {
60− passwordInput.text = "";
61− passwordInput.promptText = text;
60+ d.promptText = text;
62− passwordInput.enabled = true;
61+ passwordInput.reset();
63− passwordInput.echoMode = isSecret ? TextInput.Password : TextInput.Normal;
62+ passwordInput.isSecret = isSecret;
64 if (wasPrompted) // stay in text field if second prompt
63 if (wasPrompted) // stay in text field if second prompt
65 passwordInput.focus = true;
64 passwordInput.focus = true;
66 wasPrompted = true;
65 wasPrompted = true;
@@ -78,6 +77,12 @@ Item {
78 root.resetAuthentication();
77 root.resetAuthentication();
83+ property string promptText
81 Keys.onEscapePressed: {
86 Keys.onEscapePressed: {
82 selected(currentIndex);
87 selected(currentIndex);
@@ -151,7 +156,7 @@ Item {
151 return 1 - Math.min(1, (Math.abs(highlightDist) + root.cellHeight) / ((root.numAboveBelow + 1) * root.cellHeight))
156 return 1 - Math.min(1, (Math.abs(highlightDist) + root.cellHeight) / ((root.numAboveBelow + 1) * root.cellHeight))
154− Label {
159+ FadingLabel {
155 objectName: "username" + index
160 objectName: "username" + index
157 anchors {
162 anchors {
@@ -164,8 +169,7 @@ Item {
164 topMargin: units.gu(1) + (parent.belowHighlight ? parent.belowOffset : 0)
169 topMargin: units.gu(1) + (parent.belowHighlight ? parent.belowOffset : 0)
166 text: realName
171 text: realName
167− color: "white"
172+ color: UbuntuColors.porcelain
168− elide: Text.ElideRight
170 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
174 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
@@ -208,7 +212,7 @@ Item {
208 rightMargin: units.gu(1)
212 rightMargin: units.gu(1)
211− color: "white"
215+ color: UbuntuColors.porcelain
212 width: root.width - anchors.leftMargin - anchors.rightMargin
216 width: root.width - anchors.leftMargin - anchors.rightMargin
213 fontSize: "small"
217 fontSize: "small"
214 textFormat: Text.StyledText
218 textFormat: Text.StyledText
@@ -220,7 +224,7 @@ Item {
223− TextField {
227+ GreeterPrompt {
224 id: passwordInput
228 id: passwordInput
225 objectName: "passwordInput"
229 objectName: "passwordInput"
226 anchors {
230 anchors {
@@ -228,64 +232,28 @@ Item {
228 horizontalCenter: parent.horizontalCenter
232 horizontalCenter: parent.horizontalCenter
229 margins: units.gu(1)
233 margins: units.gu(1)
231− height: units.gu(4.5)
232 width: parent.width - anchors.margins * 2
235 width: parent.width - anchors.margins * 2
233 opacity: userList.movingInternally ? 0 : 1
236 opacity: userList.movingInternally ? 0 : 1
235− inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
238+ isPrompt: root.wasPrompted
239+ isAlphanumeric: root.alphanumeric
237− property string promptText
238− placeholderText: root.wasPrompted ? promptText
241+ text: root.wasPrompted ? d.promptText
239− : (root.locked ? i18n.tr("Retry")
242+ : (root.locked ? i18n.tr("Retry")
240− : i18n.tr("Tap to unlock"))
243+ : i18n.tr("Log In"))
245+ onClicked: root.tryToUnlock()
246+ onResponded: root.responded(text)
247+ onCanceled: root.selected(currentIndex)
242 Behavior on opacity {
249 Behavior on opacity {
243 NumberAnimation { duration: 100 }
250 NumberAnimation { duration: 100 }
249− root.focus = true; // so that it can handle Escape presses for us
251− root.responded(text);
253− Keys.onEscapePressed: {
254− root.selected(currentIndex);
260− rightMargin: units.gu(2)
261− verticalCenter: parent.verticalCenter
263− visible: !root.wasPrompted
264− source: "graphics/icon_arrow.png"
267 WrongPasswordAnimation {
253 WrongPasswordAnimation {
268 id: wrongPasswordAnimation
254 id: wrongPasswordAnimation
269 target: passwordInput
255 target: passwordInput
273− target: Qt.inputMethod
275− if (!Qt.inputMethod.visible) {
276− passwordInput.focus = false;
284− id: passwordMouseArea
285− objectName: "passwordMouseArea"
286− anchors.fill: passwordInput
287− enabled: !root.wasPrompted
288− onClicked: root.tryToUnlock()
291 function resetAuthentication() {
259 function resetAuthentication() {
@@ -293,10 +261,8 @@ Item {
295 infoLabel.text = "";
263 infoLabel.text = "";
296− passwordInput.promptText = "";
264+ d.promptText = "";
297− passwordInput.text = "";
265+ passwordInput.reset();
298− passwordInput.focus = false;
299− passwordInput.enabled = true;
300 root.wasPrompted = false;
266 root.wasPrompted = false;