on xenial help sign in
initial merge
6768946Michael Terry
qml/Components/FadingLabel.qmlnew file+42
@@ -0,0 +1,42 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ *
4+ * 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+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import QtGraphicalEffects 1.0
19+import Ubuntu.Components 1.3
20+
21+Label {
22+ property real fadeDistance: units.gu(8)
23+
24+ layer.enabled: contentWidth > width
25+ layer.effect: ShaderEffect {
26+ property real fadeThreshold: Math.min(1, Math.max(0, 1 - fadeDistance / width))
27+
28+ fragmentShader: "
29+ varying highp vec2 qt_TexCoord0;
30+ uniform lowp float qt_Opacity;
31+ uniform sampler2D source;
32+ uniform lowp float fadeThreshold;
33+ void main(void)
34+ {
35+ highp vec4 sourceColor = texture2D(source, qt_TexCoord0);
36+ lowp float alpha = 1.0;
37+ if (qt_TexCoord0.x > fadeThreshold && fadeThreshold < 1.0)
38+ alpha = (1.0 - qt_TexCoord0.x) / (1.0 - fadeThreshold);
39+ gl_FragColor = sourceColor * alpha * qt_Opacity;
40+ }"
41+ }
42+}
qml/Greeter/CoverPage.qml+1
@@ -88,6 +88,7 @@ Showable {
88 sourceSize.width: width
88 sourceSize.width: width
89 }
89 }
90
90
91+ // Darkens wallpaper so that we can read text on it and see infographic
91 Rectangle {
92 Rectangle {
92 anchors.fill: parent
93 anchors.fill: parent
93 color: "black"
94 color: "black"
qml/Greeter/GreeterPrompt.qmlnew file+142
@@ -0,0 +1,142 @@
1+/*
2+ * Copyright (C) 2016 Canonical, Ltd.
3+ *
4+ * 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+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+
20+FocusScope {
21+ id: root
22+ implicitHeight: units.gu(5)
23+ focus: true
24+
25+ property bool isPrompt
26+ property bool isAlphanumeric
27+ property string text
28+ property bool isSecret
29+
30+ signal clicked()
31+ signal canceled()
32+ signal responded(string text)
33+
34+ function reset() {
35+ passwordInput.text = "";
36+ d.enabled = true;
37+ }
38+
39+ StyledItem {
40+ id: d
41+
42+ property bool enabled: true
43+ readonly property color textColor: passwordInput.enabled ? theme.palette.normal.raisedText
44+ : theme.palette.disabled.raisedText
45+ readonly property color selectedColor: passwordInput.enabled ? theme.palette.normal.raised
46+ : theme.palette.disabled.raised
47+ readonly property color drawColor: passwordInput.enabled ? theme.palette.normal.raisedSecondaryText
48+ : theme.palette.disabled.raisedSecondaryText
49+ readonly property color errorColor: passwordInput.enabled ? theme.palette.normal.negative
50+ : theme.palette.disabled.negative
51+ }
52+
53+ Rectangle {
54+ anchors.fill: parent
55+ border.width: units.dp(1)
56+ border.color: d.drawColor
57+ radius: units.gu(0.5)
58+ color: "transparent"
59+ }
60+
61+ AbstractButton {
62+ objectName: "promptButton"
63+ anchors.fill: parent
64+ visible: !root.isPrompt
65+ enabled: d.enabled
66+ focus: visible
67+
68+ onClicked: root.clicked()
69+
70+ Label {
71+ anchors.centerIn: parent
72+ color: d.textColor
73+ text: root.text
74+ }
75+ }
76+
77+ TextField {
78+ id: passwordInput
79+ objectName: "promptField"
80+ anchors.fill: parent
81+ visible: root.isPrompt
82+ enabled: d.enabled
83+ focus: visible
84+
85+ inputMethodHints: root.isAlphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
86+ echoMode: root.isSecret ? TextInput.Password : TextInput.Normal
87+ hasClearButton: false
88+
89+ readonly property real frameSpacing: units.gu(0.5)
90+
91+ style: Item {
92+ property color color: d.textColor
93+ property color selectedTextColor: d.selectedColor
94+ property color selectionColor: d.textColor
95+ property color borderColor: "transparent"
96+ property color backgroundColor: "transparent"
97+ property color errorColor: d.errorColor
98+ property real frameSpacing: passwordInput.frameSpacing
99+ anchors.fill: parent
100+ }
101+
102+ secondaryItem: [
103+ Icon {
104+ id: capsIcon
105+ name: "keyboard-caps-enabled"
106+ height: units.gu(3)
107+ width: units.gu(3)
108+ color: d.textColor
109+ visible: root.isSecret && false // TODO: detect when caps lock is on
110+ }
111+ ]
112+
113+ onAccepted: {
114+ if (!enabled)
115+ return;
116+ d.enabled = false;
117+ root.responded(text);
118+ }
119+
120+ Keys.onEscapePressed: root.canceled()
121+
122+ // We use our own custom placeholder label instead of the standard
123+ // TextField one because the standard one hardcodes baseText as the
124+ // palette color, whereas we want raisedSecondaryText.
125+ Label {
126+ id: hint
127+ anchors {
128+ left: parent.left
129+ right: parent.right
130+ verticalCenter: parent.verticalCenter
131+ leftMargin: units.gu(1.5)
132+ rightMargin: anchors.leftMargin +
133+ (capsIcon.visible ? capsIcon.width + passwordInput.frameSpacing
134+ : 0)
135+ }
136+ text: root.text
137+ visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
138+ color: d.drawColor
139+ elide: Text.ElideRight
140+ }
141+ }
142+}
qml/Greeter/LoginAreaContainer.qml+19−8
@@ -15,13 +15,24 @@
15 */
15 */
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18−import "." 0.1
18+import Ubuntu.Components 1.3
19
19
20−Rectangle {
20+Item {
21+ BorderImage {
22+ anchors {
23+ fill: parent
21− height: units.gu(10)
24+ topMargin: -units.gu(1)
22− color: Qt.rgba(0.1, 0.1, 0.1, 0.4)
25+ leftMargin: -units.gu(1.5)
23− border.color: Qt.rgba(0.4, 0.4, 0.4, 0.4)
26+ rightMargin: -units.gu(1.5)
24− border.width: units.dp(1)
27+ bottomMargin: -units.gu(1.5)
25− radius: units.gu(1.5)
28+ }
26− antialiasing: true
29+ source: "../Stages/graphics/dropshadow2gu.sci"
30+ opacity: 0.35
31+ }
32+
33+ UbuntuShape {
34+ anchors.fill: parent
35+ aspect: UbuntuShape.Flat
36+ backgroundColor: theme.palette.normal.raised
37+ }
27}
38}
qml/Greeter/LoginList.qml+46−70
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * 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
5 * it under the terms of the GNU General Public License as published by
@@ -15,11 +15,12 @@
15 */
15 */
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18+import QtGraphicalEffects 1.0
18import Ubuntu.Components 1.3
19import Ubuntu.Components 1.3
19import "../Components"
20import "../Components"
20import "." 0.1
21import "." 0.1
21
22
22−Item {
23+StyledItem {
23 id: root
24 id: root
24
25
25 property alias model: userList.model
26 property alias model: userList.model
@@ -29,7 +30,7 @@ Item {
29
30
30 readonly property int numAboveBelow: 4
31 readonly property int numAboveBelow: 4
31 readonly property int cellHeight: units.gu(5)
32 readonly property int cellHeight: units.gu(5)
32− readonly property int highlightedHeight: units.gu(10)
33+ readonly property int highlightedHeight: units.gu(15)
33 readonly property int moveDuration: 200
34 readonly property int moveDuration: 200
34 property string selectedSession
35 property string selectedSession
35 property string currentSession: selectedSession ?
36 property string currentSession: selectedSession ?
@@ -66,10 +67,9 @@ Item {
66 }
67 }
67
68
68 function showPrompt(text, isSecret, isDefaultPrompt) {
69 function showPrompt(text, isSecret, isDefaultPrompt) {
69− passwordInput.text = "";
70− passwordInput.promptText = text;
70+ d.promptText = text;
71− passwordInput.enabled = true;
71+ passwordInput.reset();
72− passwordInput.echoMode = isSecret ? TextInput.Password : TextInput.Normal;
72+ passwordInput.isSecret = isSecret;
73 if (wasPrompted) // stay in text field if second prompt
73 if (wasPrompted) // stay in text field if second prompt
74 passwordInput.focus = true;
74 passwordInput.focus = true;
75 wasPrompted = true;
75 wasPrompted = true;
@@ -87,6 +87,16 @@ Item {
87 root.resetAuthentication();
87 root.resetAuthentication();
88 }
88 }
89
89
90+ QtObject {
91+ id: d
92+
93+ property string promptText
94+ }
95+
96+ theme: ThemeSettings {
97+ name: "Ubuntu.Components.Themes.Ambiance"
98+ }
99+
90 Keys.onEscapePressed: {
100 Keys.onEscapePressed: {
91 selected(currentIndex);
101 selected(currentIndex);
92 }
102 }
@@ -99,10 +109,14 @@ Item {
99 id: highlightItem
109 id: highlightItem
100 anchors {
110 anchors {
101 left: parent.left
111 left: parent.left
112+ leftMargin: units.gu(2)
102 right: parent.right
113 right: parent.right
114+ rightMargin: units.gu(2)
103 verticalCenter: parent.verticalCenter
115 verticalCenter: parent.verticalCenter
104 }
116 }
105
117
118+ height: root.highlightedHeight
119+
106 z: sessionChooser.visible ? userList.z + 1 : z
120 z: sessionChooser.visible ? userList.z + 1 : z
107
121
108 // Use an AbstractButton due to icon limitations with Button
122 // Use an AbstractButton due to icon limitations with Button
@@ -152,6 +166,8 @@ Item {
152 objectName: "userList"
166 objectName: "userList"
153
167
154 anchors.fill: parent
168 anchors.fill: parent
169+ anchors.leftMargin: units.gu(2)
170+ anchors.rightMargin: units.gu(2)
155
171
156 preferredHighlightBegin: userList.height / 2 - root.highlightedHeight / 2
172 preferredHighlightBegin: userList.height / 2 - root.highlightedHeight / 2
157 preferredHighlightEnd: userList.height / 2 - root.highlightedHeight / 2
173 preferredHighlightEnd: userList.height / 2 - root.highlightedHeight / 2
@@ -198,7 +214,7 @@ Item {
198 return 1 - Math.min(1, (Math.abs(highlightDist) + root.cellHeight) / ((root.numAboveBelow + 1) * root.cellHeight))
214 return 1 - Math.min(1, (Math.abs(highlightDist) + root.cellHeight) / ((root.numAboveBelow + 1) * root.cellHeight))
199 }
215 }
200
216
201− Label {
217+ FadingLabel {
202 objectName: "username" + index
218 objectName: "username" + index
203
219
204 anchors {
220 anchors {
@@ -206,13 +222,12 @@ Item {
206 leftMargin: units.gu(2)
222 leftMargin: units.gu(2)
207 right: parent.right
223 right: parent.right
208 rightMargin: units.gu(2)
224 rightMargin: units.gu(2)
209− top: parent.top
225+ bottom: parent.top
210− // Add an offset to topMargin for any items below the highlight
226+ // Add an offset to bottomMargin for any items below the highlight
211− topMargin: units.gu(1) + (parent.belowHighlight ? parent.belowOffset : 0)
227+ bottomMargin: -(units.gu(4) + (parent.belowHighlight ? parent.belowOffset : 0))
212 }
228 }
213 text: realName
229 text: realName
214− color: "white"
230+ color: userList.currentIndex !== index ? theme.palette.normal.raised : theme.palette.normal.raisedText
215− elide: Text.ElideRight
216
231
217 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
232 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
218 }
233 }
@@ -243,23 +258,22 @@ Item {
243 }
258 }
244 }
259 }
245
260
246− Label {
261+ FadingLabel {
247 id: infoLabel
262 id: infoLabel
248 objectName: "infoLabel"
263 objectName: "infoLabel"
249 anchors {
264 anchors {
250 bottom: passwordInput.top
265 bottom: passwordInput.top
251− left: parent.left
266+ left: highlightItem.left
252 topMargin: units.gu(1)
267 topMargin: units.gu(1)
253 bottomMargin: units.gu(1)
268 bottomMargin: units.gu(1)
254 leftMargin: units.gu(2)
269 leftMargin: units.gu(2)
255 rightMargin: units.gu(1)
270 rightMargin: units.gu(1)
256 }
271 }
257
272
258− color: "white"
273+ color: theme.palette.normal.raisedText
259 width: root.width - anchors.leftMargin - anchors.rightMargin
274 width: root.width - anchors.leftMargin - anchors.rightMargin
260 fontSize: "small"
275 fontSize: "small"
261 textFormat: Text.StyledText
276 textFormat: Text.StyledText
262− clip: true
263
277
264 opacity: (userList.movingInternally || text == "") ? 0 : 1
278 opacity: (userList.movingInternally || text == "") ? 0 : 1
265 Behavior on opacity {
279 Behavior on opacity {
@@ -267,72 +281,36 @@ Item {
267 }
281 }
268 }
282 }
269
283
270− TextField {
284+ GreeterPrompt {
271 id: passwordInput
285 id: passwordInput
272 objectName: "passwordInput"
286 objectName: "passwordInput"
273 anchors {
287 anchors {
274 bottom: highlightItem.bottom
288 bottom: highlightItem.bottom
275− horizontalCenter: parent.horizontalCenter
289+ horizontalCenter: highlightItem.horizontalCenter
276− margins: units.gu(1)
290+ margins: units.gu(2)
277 }
291 }
278− height: units.gu(4.5)
279− width: parent.width - anchors.margins * 2
292+ width: highlightItem.width - anchors.margins * 2
280 opacity: userList.movingInternally ? 0 : 1
293 opacity: userList.movingInternally ? 0 : 1
281
294
282− inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
295+ isPrompt: root.wasPrompted
296+ isAlphanumeric: root.alphanumeric
283
297
284− property string promptText
285− placeholderText: root.wasPrompted ? promptText
298+ text: root.wasPrompted ? d.promptText
286− : (root.locked ? i18n.tr("Retry")
299+ : (root.locked ? i18n.tr("Retry")
287− : i18n.tr("Tap to unlock"))
300+ : i18n.tr("Log In"))
301+
302+ onClicked: root.tryToUnlock()
303+ onResponded: root.responded(text)
304+ onCanceled: root.selected(currentIndex)
288
305
289 Behavior on opacity {
306 Behavior on opacity {
290 NumberAnimation { duration: 100 }
307 NumberAnimation { duration: 100 }
291 }
308 }
292
309
293− onAccepted: {
294− if (!enabled)
295− return;
296− root.focus = true; // so that it can handle Escape presses for us
297− enabled = false;
298− root.responded(text);
299− }
300− Keys.onEscapePressed: {
301− root.selected(currentIndex);
302− }
303−
304− Image {
305− anchors {
306− right: parent.right
307− rightMargin: units.gu(2)
308− verticalCenter: parent.verticalCenter
309− }
310− visible: !root.wasPrompted
311− source: "graphics/icon_arrow.png"
312− }
313−
314 WrongPasswordAnimation {
310 WrongPasswordAnimation {
315 id: wrongPasswordAnimation
311 id: wrongPasswordAnimation
316 target: passwordInput
312 target: passwordInput
317 }
313 }
318−
319− Connections {
320− target: Qt.inputMethod
321− onVisibleChanged: {
322− if (!Qt.inputMethod.visible) {
323− passwordInput.focus = false;
324− }
325− }
326− }
327−
328− }
329−
330− MouseArea {
331− id: passwordMouseArea
332− objectName: "passwordMouseArea"
333− anchors.fill: passwordInput
334− enabled: !root.wasPrompted
335− onClicked: root.tryToUnlock()
336 }
314 }
337
315
338 function resetAuthentication() {
316 function resetAuthentication() {
@@ -340,10 +318,8 @@ Item {
340 return;
318 return;
341 }
319 }
342 infoLabel.text = "";
320 infoLabel.text = "";
343− passwordInput.promptText = "";
321+ d.promptText = "";
344− passwordInput.text = "";
322+ passwordInput.reset();
345− passwordInput.focus = false;
346− passwordInput.enabled = true;
347 root.wasPrompted = false;
323 root.wasPrompted = false;
348 }
324 }
349}
325}
qml/Greeter/WideView.qml+1−1
@@ -149,7 +149,7 @@ FocusScope {
149 top: parent.top
149 top: parent.top
150 }
150 }
151
151
152− width: units.gu(29)
152+ width: units.gu(40)
153 height: inputMethod && inputMethod.visible ?
153 height: inputMethod && inputMethod.visible ?
154 parent.height - inputMethod.keyboardRectangle.height : parent.height
154 parent.height - inputMethod.keyboardRectangle.height : parent.height
155
155
tests/mocks/LightDM/IntegratedLightDM/liblightdm/UsersModelPrivate.cpp+2−2
@@ -88,8 +88,8 @@ void UsersModelPrivate::resetEntries_full()
88 { "html-info-prompt", "HTML Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
88 { "html-info-prompt", "HTML Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
89 { "long-info-prompt", "Long Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
89 { "long-info-prompt", "Long Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
90 { "wide-info-prompt", "Wide Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
90 { "wide-info-prompt", "Wide Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
91− { "multi-info-prompt", "Multi Info Prompt", 0, 0, false, false, "Ububntu", 0 },
91+ { "multi-info-prompt", "Multi Info Prompt", 0, 0, false, false, "Ubuntu", 0 },
92− { "long-name", "Long name (far far too long to fit)", 0, 0, false, false, "Ubuntu", 0 },
92+ { "long-name", "Long name (far far too long to fit, seriously this would never fit on the screen, you will never see this part of the name)", 0, 0, false, false, "Ubuntu", 0 },
93 { "color-background", "Color Background", "#dd4814", 0, false, false, "Ubuntu", 0 },
93 { "color-background", "Color Background", "#dd4814", 0, false, false, "Ubuntu", 0 },
94 // white and black are a bit redundant, but useful for manually testing if UI is still readable
94 // white and black are a bit redundant, but useful for manually testing if UI is still readable
95 { "white-background", "White Background", "#ffffff", 0, false, false, "Ubuntu", 0 },
95 { "white-background", "White Background", "#ffffff", 0, false, false, "Ubuntu", 0 },
tests/qmltests/Greeter/tst_WideView.qml+21−28
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
4 * 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
5 * it under the terms of the GNU General Public License as published by
@@ -22,11 +22,13 @@ import LightDM.IntegratedLightDM 0.1 as LightDM
22import Ubuntu.Components 1.3
22import Ubuntu.Components 1.3
23import Unity.Test 0.1 as UT
23import Unity.Test 0.1 as UT
24
24
25−Item {
25+StyledItem {
26 id: root
26 id: root
27 width: units.gu(120)
27 width: units.gu(120)
28 height: units.gu(80)
28 height: units.gu(80)
29
29
30+ theme.name: "Ubuntu.Components.Themes.SuruDark"
31+
30 Binding {
32 Binding {
31 target: LightDM.Users
33 target: LightDM.Users
32 property: "mockMode"
34 property: "mockMode"
@@ -103,7 +105,7 @@ Item {
103
105
104 Rectangle {
106 Rectangle {
105 id: controls
107 id: controls
106− color: "white"
108+ color: theme.palette.normal.background
107 width: units.gu(40)
109 width: units.gu(40)
108 height: parent.height
110 height: parent.height
109
111
@@ -489,8 +491,8 @@ Item {
489 view.locked = true;
491 view.locked = true;
490 view.showPrompt("Prompt", true, true);
492 view.showPrompt("Prompt", true, true);
491 var passwordInput = findChild(view, "passwordInput");
493 var passwordInput = findChild(view, "passwordInput");
492− compare(passwordInput.placeholderText, "Prompt");
494+ compare(passwordInput.text, "Prompt");
493− compare(passwordInput.echoMode, TextInput.Password);
495+ verify(passwordInput.isSecret);
494 tap(passwordInput);
496 tap(passwordInput);
495 typeString("password");
497 typeString("password");
496 keyClick(Qt.Key_Enter);
498 keyClick(Qt.Key_Enter);
@@ -502,8 +504,8 @@ Item {
502 view.locked = true;
504 view.locked = true;
503 view.showPrompt("otp", false, false);
505 view.showPrompt("otp", false, false);
504 var passwordInput = findChild(view, "passwordInput");
506 var passwordInput = findChild(view, "passwordInput");
505− compare(passwordInput.placeholderText, "otp");
507+ compare(passwordInput.text, "otp");
506− compare(passwordInput.echoMode, TextInput.Normal);
508+ verify(!passwordInput.isSecret);
507 tap(passwordInput);
509 tap(passwordInput);
508 typeString("foo");
510 typeString("foo");
509 keyClick(Qt.Key_Enter);
511 keyClick(Qt.Key_Enter);
@@ -536,7 +538,6 @@ Item {
536 var infoLabel = findChild(view, "infoLabel");
538 var infoLabel = findChild(view, "infoLabel");
537 compare(infoLabel.text, "Welcome to Unity Greeter<br><font color=\"#df382c\">This is an error</font><br>You should have seen three messages and this is a really long message too. wow so long much length");
539 compare(infoLabel.text, "Welcome to Unity Greeter<br><font color=\"#df382c\">This is an error</font><br>You should have seen three messages and this is a really long message too. wow so long much length");
538 compare(infoLabel.textFormat, Text.StyledText);
540 compare(infoLabel.textFormat, Text.StyledText);
539− compare(infoLabel.clip, true);
540 verify(infoLabel.contentWidth > infoLabel.width);
541 verify(infoLabel.contentWidth > infoLabel.width);
541 verify(infoLabel.opacity < 1);
542 verify(infoLabel.opacity < 1);
542 tryCompare(infoLabel, "opacity", 1);
543 tryCompare(infoLabel, "opacity", 1);
@@ -548,15 +549,15 @@ Item {
548 selectedSpy.clear();
549 selectedSpy.clear();
549 view.locked = true;
550 view.locked = true;
550 view.showPrompt("Prompt", true, true);
551 view.showPrompt("Prompt", true, true);
551− var passwordInput = findChild(view, "passwordInput");
552+ var promptField = findChild(view, "promptField");
552− tap(passwordInput);
553+ tap(promptField);
553− compare(passwordInput.focus, true);
554+ compare(promptField.focus, true);
554− compare(passwordInput.enabled, true);
555+ compare(promptField.enabled, true);
555
556
556 typeString("password");
557 typeString("password");
557 keyClick(Qt.Key_Enter);
558 keyClick(Qt.Key_Enter);
558− compare(passwordInput.focus, false);
559+ compare(promptField.focus, true);
559− compare(passwordInput.enabled, false);
560+ compare(promptField.enabled, false);
560
561
561 compare(selectedSpy.count, 0);
562 compare(selectedSpy.count, 0);
562 keyClick(Qt.Key_Escape);
563 keyClick(Qt.Key_Escape);
@@ -564,8 +565,8 @@ Item {
564 compare(selectedSpy.signalArguments[0][0], 1);
565 compare(selectedSpy.signalArguments[0][0], 1);
565
566
566 view.reset();
567 view.reset();
567− compare(passwordInput.focus, false);
568+ compare(promptField.focus, false);
568− compare(passwordInput.enabled, true);
569+ compare(promptField.enabled, true);
569 }
570 }
570
571
571 function test_unicode() {
572 function test_unicode() {
@@ -574,17 +575,11 @@ Item {
574 tryCompare(label, "text", "가나다라마");
575 tryCompare(label, "text", "가나다라마");
575 }
576 }
576
577
577− function test_longName() {
578− var index = selectUser("long-name");
579− var label = findChild(view, "username" + index);
580− tryCompare(label, "truncated", true);
581− }
582−
583 function test_promptless() {
578 function test_promptless() {
584 var passwordInput = findChild(view, "passwordInput");
579 var passwordInput = findChild(view, "passwordInput");
585
580
586 view.locked = true;
581 view.locked = true;
587− compare(passwordInput.placeholderText, "Retry");
582+ compare(passwordInput.text, "Retry");
588 tap(passwordInput);
583 tap(passwordInput);
589 compare(respondedSpy.count, 0);
584 compare(respondedSpy.count, 0);
590 compare(selectedSpy.count, 1);
585 compare(selectedSpy.count, 1);
@@ -592,7 +587,7 @@ Item {
592 selectedSpy.clear();
587 selectedSpy.clear();
593
588
594 view.locked = false;
589 view.locked = false;
595− compare(passwordInput.placeholderText, "Tap to unlock");
590+ compare(passwordInput.text, "Log In");
596 tap(passwordInput);
591 tap(passwordInput);
597 compare(selectedSpy.count, 0);
592 compare(selectedSpy.count, 0);
598 compare(respondedSpy.count, 1);
593 compare(respondedSpy.count, 1);
@@ -624,11 +619,9 @@ Item {
624 var passwordInput = findChild(view, "passwordInput");
619 var passwordInput = findChild(view, "passwordInput");
625
620
626 verify(view.alphanumeric);
621 verify(view.alphanumeric);
627− compare(passwordInput.inputMethodHints, Qt.ImhNone);
622+ verify(passwordInput.isAlphanumeric);
628 view.alphanumeric = false;
623 view.alphanumeric = false;
629− compare(passwordInput.inputMethodHints, Qt.ImhDigitsOnly);
624+ verify(!passwordInput.isAlphanumeric);
630− view.alphanumeric = true;
631− compare(passwordInput.inputMethodHints, Qt.ImhNone);
632 }
625 }
633 }
626 }
634}
627}
tests/qmltests/tst_Shell.qml+8−4
@@ -810,10 +810,14 @@ Rectangle {
810 var greeter = findChild(shell, "greeter")
810 var greeter = findChild(shell, "greeter")
811 tryCompare(greeter, "fullyShown", true);
811 tryCompare(greeter, "fullyShown", true);
812
812
813− var passwordMouseArea = findChild(shell, "passwordMouseArea")
813+ var passwordInput = findChild(shell, "passwordInput");
814+
815+ var promptButton = findChild(passwordInput, "promptButton");
816+ tryCompare(promptButton, "visible", isButton);
817+
818+ var promptField = findChild(passwordInput, "promptField");
814− tryCompare(passwordMouseArea, "enabled", isButton)
819+ tryCompare(promptField, "visible", !isButton);
815
820
816− var passwordInput = findChild(shell, "passwordInput")
817 mouseClick(passwordInput)
821 mouseClick(passwordInput)
818 }
822 }
819
823
@@ -2372,7 +2376,7 @@ Rectangle {
2372 function test_switchKeymap() {
2376 function test_switchKeymap() {
2373 // start with phone shell
2377 // start with phone shell
2374 loadShell("phone");
2378 loadShell("phone");
2375− shell.usageScenario = "shell";
2379+ shell.usageScenario = "phone";
2376 waitForRendering(shell);
2380 waitForRendering(shell);
2377 swipeAwayGreeter();
2381 swipeAwayGreeter();
2378
2382