on xenial help sign in
Be smoother about focus in GreeterPrompt
commitc63198f9d1ea12499ae78e0d0fca2f4f8e054241 authorMichael Terry <michael.terry@canonical.com> dateWed 6 Jul 2016, 11:34 (10 years ago) parent0281737
1 file changed+11−5
qml/Greeter/GreeterPrompt.qml+11−5
qml/Greeter/GreeterPrompt.qml+11−5
@@ -66,6 +66,12 @@ FocusScope {
6666 visible: !root.isPrompt
6767 focus: visible
6868
69+ onVisibleChanged: {
70+ // Qt owns focus, we can't keep our binding active. So make sure
71+ // focus stays in sync manually.
72+ focus = visible;
73+ }
74+
6975 onClicked: {
7076 if (d.enabled) {
7177 d.enabled = false;
@@ -86,12 +92,12 @@ FocusScope {
8692 anchors.fill: parent
8793 visible: root.isPrompt
8894 opacity: fakeLabel.visible ? 0 : 1
95+ focus: visible
8996
90− // Oddly, a simple "focus: visible" does not stick -- the binding
91− // gets lost when switching between buttons and prompts. But this
92− // explicit binding does work.
93− Binding on focus {
94− value: passwordInput.visible
97+ onVisibleChanged: {
98+ // Qt owns focus, we can't keep our binding active. So make sure
99+ // focus stays in sync manually.
100+ focus = visible;
95101 }
96102
97103 validator: RegExpValidator {