@@ -32,14 +32,25 @@ FocusScope {
3232
3333 function reset() {
3434 passwordInput.text = "";
35− passwordInput.focus = false;
36− passwordInput.enabled = true;
35+ focus = false;
36+ enabled = true;
37+ }
38+
39+ StyledItem {
40+ id: d
41+
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
3748 }
3849
3950 Rectangle {
4051 anchors.fill: parent
4152 border.width: units.dp(1)
42− border.color: UbuntuColors.porcelain
53+ border.color: d.color
4354 radius: units.gu(0.5)
4455 color: "transparent"
4556 }
@@ -52,7 +63,7 @@ FocusScope {
5263
5364 Label {
5465 anchors.centerIn: parent
55− color: UbuntuColors.porcelain
66+ color: d.color
5667 text: root.text
5768 }
5869 }
@@ -68,12 +79,12 @@ FocusScope {
6879 hasClearButton: false
6980
7081 style: Item {
71− property color color: UbuntuColors.porcelain
72− property color selectedTextColor: UbuntuColors.jet
73− property color selectionColor: UbuntuColors.porcelain
82+ property color color: d.color
83+ property color selectedTextColor: d.inverseColor
84+ property color selectionColor: d.color
7485 property color borderColor: "transparent"
7586 property color backgroundColor: "transparent"
76− property color errorColor: UbuntuColors.red
87+ property color errorColor: d.errorColor
7788 property real frameSpacing: units.gu(0.5)
7889 anchors.fill: parent
7990
@@ -89,16 +100,21 @@ FocusScope {
89100 name: "keyboard-caps-enabled"
90101 height: units.gu(2)
91102 width: units.gu(2)
92− color: UbuntuColors.porcelain
93− visible: false // TODO: detect when caps lock is on
103+ color: d.color
104+ visible: root.isSecret && false // TODO: detect when caps lock is on
94105 }
95106 ]
96107
108+ cursorDelegate: Rectangle {
109+ width: units.dp(1)
110+ color: d.color
111+ }
112+
97113 onAccepted: {
98− if (!enabled)
114+ if (!root.enabled)
99115 return;
100116 root.focus = true; // so that it can handle Escape presses for us
101− enabled = false;
117+ root.enabled = false;
102118 root.responded(text);
103119 }
104120
@@ -107,7 +123,7 @@ FocusScope {
107123 Connections {
108124 target: Qt.inputMethod
109125 onVisibleChanged: {
110− if (!Qt.inputMethod.visible) {
126+ if (passwordInput.visible && !Qt.inputMethod.visible) {
111127 passwordInput.focus = false;
112128 }
113129 }