@@ -32,14 +32,25 @@ FocusScope {
33 function reset() {
33 function reset() {
34 passwordInput.text = "";
34 passwordInput.text = "";
35− passwordInput.focus = false;
35+ focus = false;
36− passwordInput.enabled = true;
36+ enabled = true;
42+ property color color: root.enabled ? theme.palette.normal.backgroundText
43+ : theme.palette.disabled.backgroundText
44+ property color inverseColor: root.enabled ? theme.palette.normal.background
45+ : theme.palette.disabled.background
46+ property color errorColor: root.enabled ? theme.palette.normal.negative
47+ : theme.palette.disabled.negative
39 Rectangle {
50 Rectangle {
40 anchors.fill: parent
51 anchors.fill: parent
41 border.width: units.dp(1)
52 border.width: units.dp(1)
42− border.color: UbuntuColors.porcelain
53+ border.color: d.color
43 radius: units.gu(0.5)
54 radius: units.gu(0.5)
44 color: "transparent"
55 color: "transparent"
@@ -52,7 +63,7 @@ FocusScope {
54 anchors.centerIn: parent
65 anchors.centerIn: parent
55− color: UbuntuColors.porcelain
66+ color: d.color
56 text: root.text
67 text: root.text
@@ -68,12 +79,12 @@ FocusScope {
68 hasClearButton: false
79 hasClearButton: false
70 style: Item {
81 style: Item {
71− property color color: UbuntuColors.porcelain
82+ property color color: d.color
72− property color selectedTextColor: UbuntuColors.jet
83+ property color selectedTextColor: d.inverseColor
73− property color selectionColor: UbuntuColors.porcelain
84+ property color selectionColor: d.color
74 property color borderColor: "transparent"
85 property color borderColor: "transparent"
75 property color backgroundColor: "transparent"
86 property color backgroundColor: "transparent"
76− property color errorColor: UbuntuColors.red
87+ property color errorColor: d.errorColor
77 property real frameSpacing: units.gu(0.5)
88 property real frameSpacing: units.gu(0.5)
78 anchors.fill: parent
89 anchors.fill: parent
@@ -89,16 +100,21 @@ FocusScope {
89 name: "keyboard-caps-enabled"
100 name: "keyboard-caps-enabled"
90 height: units.gu(2)
101 height: units.gu(2)
91 width: units.gu(2)
102 width: units.gu(2)
92− color: UbuntuColors.porcelain
103+ color: d.color
93− visible: false // TODO: detect when caps lock is on
104+ visible: root.isSecret && false // TODO: detect when caps lock is on
108+ cursorDelegate: Rectangle {
97 onAccepted: {
113 onAccepted: {
98− if (!enabled)
114+ if (!root.enabled)
100 root.focus = true; // so that it can handle Escape presses for us
116 root.focus = true; // so that it can handle Escape presses for us
101− enabled = false;
117+ root.enabled = false;
102 root.responded(text);
118 root.responded(text);
@@ -107,7 +123,7 @@ FocusScope {
107 Connections {
123 Connections {
108 target: Qt.inputMethod
124 target: Qt.inputMethod
109 onVisibleChanged: {
125 onVisibleChanged: {
110− if (!Qt.inputMethod.visible) {
126+ if (passwordInput.visible && !Qt.inputMethod.visible) {
111 passwordInput.focus = false;
127 passwordInput.focus = false;