@@ -20,6 +20,7 @@ import Ubuntu.Components 1.3
20FocusScope {
20FocusScope {
22 implicitHeight: units.gu(5)
22 implicitHeight: units.gu(5)
24 property bool isPrompt
25 property bool isPrompt
25 property bool isAlphanumeric
26 property bool isAlphanumeric
@@ -32,7 +33,6 @@ FocusScope {
33 function reset() {
34 function reset() {
34 passwordInput.text = "";
35 passwordInput.text = "";
36 d.enabled = true;
36 d.enabled = true;
@@ -63,6 +63,7 @@ FocusScope {
63 anchors.fill: parent
63 anchors.fill: parent
64 visible: !root.isPrompt
64 visible: !root.isPrompt
65 enabled: d.enabled
65 enabled: d.enabled
67 onClicked: root.clicked()
68 onClicked: root.clicked()
@@ -79,6 +80,7 @@ FocusScope {
79 anchors.fill: parent
80 anchors.fill: parent
80 visible: root.isPrompt
81 visible: root.isPrompt
81 enabled: d.enabled
82 enabled: d.enabled
83 inputMethodHints: root.isAlphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
85 inputMethodHints: root.isAlphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
84 echoMode: root.isSecret ? TextInput.Password : TextInput.Normal
86 echoMode: root.isSecret ? TextInput.Password : TextInput.Normal
@@ -111,22 +113,12 @@ FocusScope {
111 onAccepted: {
113 onAccepted: {
112 if (!enabled)
114 if (!enabled)
114− root.focus = true; // so that it can handle Escape presses for us
115 d.enabled = false;
116 d.enabled = false;
116 root.responded(text);
117 root.responded(text);
119 Keys.onEscapePressed: root.canceled()
120 Keys.onEscapePressed: root.canceled()
122− target: Qt.inputMethod
124− if (passwordInput.visible && !Qt.inputMethod.visible) {
125− passwordInput.focus = false;
130 // We use our own custom placeholder label instead of the standard
122 // We use our own custom placeholder label instead of the standard
131 // TextField one because the standard one hardcodes baseText as the
123 // TextField one because the standard one hardcodes baseText as the
132 // palette color, whereas we want raisedSecondaryText.
124 // palette color, whereas we want raisedSecondaryText.