on xenial help sign in
add the OSK icon to the password prompt field
commitbb1bf728caab7127159289b5ebd519aee1403c97 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 17 Feb 2017, 21:33 (10 years ago) parentd7a2d01
1 file changed+29−10
qml/Greeter/GreeterPrompt.qml+29−10
qml/Greeter/GreeterPrompt.qml+29−10
@@ -16,6 +16,7 @@
1616
1717import QtQuick 2.4
1818import Ubuntu.Components 1.3
19+import GSettings 1.0
1920import "../Components"
2021
2122FocusScope {
@@ -43,6 +44,11 @@ FocusScope {
4344 }
4445 }
4546
47+ GSettings {
48+ id: unity8Settings
49+ schema.id: "com.canonical.Unity8"
50+ }
51+
4652 StyledItem {
4753 id: d
4854
@@ -154,14 +160,27 @@ FocusScope {
154160 }
155161
156162 secondaryItem: [
157− Icon {
158− id: capsIcon
159− name: "keyboard-caps-enabled"
160− height: units.gu(3)
161− width: units.gu(3)
162− color: d.textColor
163− visible: root.isSecret && false // TODO: detect when caps lock is on
164− readonly property real visibleWidth: visible ? width + passwordInput.frameSpacing : 0
163+ Row {
164+ id: extraIcons
165+ spacing: passwordInput.frameSpacing
166+ Icon {
167+ name: "keyboard-caps-enabled"
168+ height: units.gu(3)
169+ width: units.gu(3)
170+ color: d.textColor
171+ visible: root.isSecret && false // TODO: detect when caps lock is on
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+ }
165184 }
166185 ]
167186
@@ -199,7 +218,7 @@ FocusScope {
199218 right: parent.right
200219 verticalCenter: parent.verticalCenter
201220 leftMargin: units.gu(1.5)
202− rightMargin: anchors.leftMargin + capsIcon.visibleWidth
221+ rightMargin: anchors.leftMargin + extraIcons.width
203222 }
204223 text: root.text
205224 visible: passwordInput.text == "" && !passwordInput.inputMethodComposing
@@ -221,7 +240,7 @@ FocusScope {
221240 anchors.left: parent.left
222241 anchors.right: parent.right
223242 anchors.leftMargin: passwordInput.frameSpacing * 2
224− anchors.rightMargin: passwordInput.frameSpacing * 2 + capsIcon.visibleWidth
243+ anchors.rightMargin: passwordInput.frameSpacing * 2 + extraIcons.width
225244 color: d.drawColor
226245 text: passwordInput.displayText
227246 visible: root.isPrompt && !root.interactive