[gnome-shell] network-agent: Focus the first reactive entry
- From: Florian MÃllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] network-agent: Focus the first reactive entry
- Date: Mon, 19 Sep 2011 19:30:04 +0000 (UTC)
commit 4e4ce0dd218310337e849ac02de8a174a93e9852
Author: Florian MÃllner <fmuellner gnome org>
Date: Thu Sep 15 01:22:29 2011 +0200
network-agent: Focus the first reactive entry
Currently network dialogs don't focus password entries, which means
that rather than entering their password directly, users first have
to click the entry (or tab around the dialog).
Instead, put keyboard focus on the first entry that requires user
input.
https://bugzilla.gnome.org/show_bug.cgi?id=659133
js/ui/networkAgent.js | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js
index 90480e7..43fd9a1 100644
--- a/js/ui/networkAgent.js
+++ b/js/ui/networkAgent.js
@@ -91,6 +91,7 @@ NetworkSecretDialog.prototype = {
}
let secretTable = new St.Table({ style_class: 'network-dialog-secret-table' });
+ let initialFocusSet = false;
let pos = 0;
for (let i = 0; i < this._content.secrets.length; i++) {
let secret = this._content.secrets[i];
@@ -109,6 +110,11 @@ NetworkSecretDialog.prototype = {
secret.valid = secret.value.length > 0;
if (reactive) {
+ if (!initialFocusSet) {
+ this.setInitialKeyFocus(secret.entry);
+ initialFocusSet = true;
+ }
+
secret.entry.clutter_text.connect('text-changed', Lang.bind(this, function() {
secret.value = secret.entry.get_text();
if (secret.validate)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]