on xenial help sign in
Use theme colors; use UbuntuShape
5407525Michael Terry
qml/Greeter/GreeterPrompt.qml+29−13
@@ -32,14 +32,25 @@ FocusScope {
32
32
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;
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
37 }
48 }
38
49
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"
45 }
56 }
@@ -52,7 +63,7 @@ FocusScope {
52
63
53 Label {
64 Label {
54 anchors.centerIn: parent
65 anchors.centerIn: parent
55− color: UbuntuColors.porcelain
66+ color: d.color
56 text: root.text
67 text: root.text
57 }
68 }
58 }
69 }
@@ -68,12 +79,12 @@ FocusScope {
68 hasClearButton: false
79 hasClearButton: false
69
80
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
79
90
@@ -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
94 }
105 }
95 ]
106 ]
96
107
108+ cursorDelegate: Rectangle {
109+ width: units.dp(1)
110+ color: d.color
111+ }
112+
97 onAccepted: {
113 onAccepted: {
98− if (!enabled)
114+ if (!root.enabled)
99 return;
115 return;
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);
103 }
119 }
104
120
@@ -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;
112 }
128 }
113 }
129 }
qml/Greeter/LoginList.qml+10−13
@@ -91,7 +91,7 @@ Item {
91 userList.currentIndex = currentIndex;
91 userList.currentIndex = currentIndex;
92 }
92 }
93
93
94− Rectangle {
94+ UbuntuShape {
95 id: highlightItem
95 id: highlightItem
96 anchors {
96 anchors {
97 left: parent.left
97 left: parent.left
@@ -99,11 +99,8 @@ Item {
99 verticalCenter: parent.verticalCenter
99 verticalCenter: parent.verticalCenter
100 }
100 }
101 height: root.highlightedHeight
101 height: root.highlightedHeight
102− color: Qt.rgba(0.1, 0.1, 0.1, 0.4)
102+ aspect: UbuntuShape.Flat
103− border.color: Qt.rgba(0.4, 0.4, 0.4, 0.4)
103+ backgroundColor: Qt.rgba(0, 0, 0, 0.4)
104− border.width: units.dp(1)
105− radius: units.gu(1.5)
106− antialiasing: true
107 }
104 }
108
105
109 ListView {
106 ListView {
@@ -161,15 +158,15 @@ Item {
161
158
162 anchors {
159 anchors {
163 left: parent.left
160 left: parent.left
164− leftMargin: units.gu(2)
161+ leftMargin: units.gu(1)
165 right: parent.right
162 right: parent.right
166− rightMargin: units.gu(2)
163+ rightMargin: units.gu(1)
167− top: parent.top
164+ bottom: parent.top
168− // Add an offset to topMargin for any items below the highlight
165+ // Add an offset to bottomMargin for any items below the highlight
169− topMargin: units.gu(1) + (parent.belowHighlight ? parent.belowOffset : 0)
166+ bottomMargin: -(units.gu(3) + (parent.belowHighlight ? parent.belowOffset : 0))
170 }
167 }
171 text: realName
168 text: realName
172− color: UbuntuColors.porcelain
169+ color: theme.palette.normal.backgroundText
173
170
174 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
171 Behavior on anchors.topMargin { NumberAnimation { duration: root.moveDuration; easing.type: Easing.InOutQuad; } }
175 }
172 }
@@ -212,7 +209,7 @@ Item {
212 rightMargin: units.gu(1)
209 rightMargin: units.gu(1)
213 }
210 }
214
211
215− color: UbuntuColors.porcelain
212+ color: theme.palette.normal.backgroundText
216 width: root.width - anchors.leftMargin - anchors.rightMargin
213 width: root.width - anchors.leftMargin - anchors.rightMargin
217 fontSize: "small"
214 fontSize: "small"
218 textFormat: Text.StyledText
215 textFormat: Text.StyledText
tests/qmltests/Greeter/tst_WideView.qml+4−2
@@ -22,11 +22,13 @@ import 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