on xenial help sign in
add the OSK icon to the password prompt field
bb1bf72Lukáš Tinkl
qml/Greeter/GreeterPrompt.qml+29−10
@@ -16,6 +16,7 @@
16
16
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19+import GSettings 1.0
19import "../Components"
20import "../Components"
20
21
21FocusScope {
22FocusScope {
@@ -43,6 +44,11 @@ FocusScope {
43 }
44 }
44 }
45 }
45
46
47+ GSettings {
48+ id: unity8Settings
49+ schema.id: "com.canonical.Unity8"
50+ }
51+
46 StyledItem {
52 StyledItem {
47 id: d
53 id: d
48
54
@@ -154,14 +160,27 @@ FocusScope {
154 }
160 }
155
161
156 secondaryItem: [
162 secondaryItem: [
157− Icon {
163+ Row {
158− id: capsIcon
164+ id: extraIcons
165+ spacing: passwordInput.frameSpacing
166+ Icon {
159− name: "keyboard-caps-enabled"
167+ name: "keyboard-caps-enabled"
160− height: units.gu(3)
168+ height: units.gu(3)
161− width: units.gu(3)
169+ width: units.gu(3)
162− color: d.textColor
170+ color: d.textColor
163− visible: root.isSecret && false // TODO: detect when caps lock is on
171+ visible: root.isSecret && false // TODO: detect when caps lock is on
164− readonly property real visibleWidth: visible ? width + passwordInput.frameSpacing : 0
172+ }
173+ Icon {
174+ name: "input-keyboard-symbolic"
175+ height: units.gu(3)
176+ width: units.gu(3)
177+ color: d.textColor
178+ visible: !unity8Settings.alwaysShowOsk
179+ MouseArea {
180+ anchors.fill: parent
181+ onClicked: unity8Settings.alwaysShowOsk = true
182+ }
183+ }
165 }
184 }
166 ]
185 ]
167
186
@@ -199,7 +218,7 @@ FocusScope {
199 right: parent.right
218 right: parent.right
200 verticalCenter: parent.verticalCenter
219 verticalCenter: parent.verticalCenter
201 leftMargin: units.gu(1.5)
220 leftMargin: units.gu(1.5)
202− rightMargin: anchors.leftMargin + capsIcon.visibleWidth
221+ rightMargin: anchors.leftMargin + extraIcons.width
203 }
222 }
204 text: root.text
223 text: root.text
205 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
224 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
@@ -221,7 +240,7 @@ FocusScope {
221 anchors.left: parent.left
240 anchors.left: parent.left
222 anchors.right: parent.right
241 anchors.right: parent.right
223 anchors.leftMargin: passwordInput.frameSpacing * 2
242 anchors.leftMargin: passwordInput.frameSpacing * 2
224− anchors.rightMargin: passwordInput.frameSpacing * 2 + capsIcon.visibleWidth
243+ anchors.rightMargin: passwordInput.frameSpacing * 2 + extraIcons.width
225 color: d.drawColor
244 color: d.drawColor
226 text: passwordInput.displayText
245 text: passwordInput.displayText
227 visible: root.isPrompt && !root.interactive
246 visible: root.isPrompt && !root.interactive