From ba110f2d2e914474888a616fc011ec5ff8df907f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20M=C3=BCllner?= Date: Thu, 8 Sep 2011 17:53:22 +0200 Subject: [PATCH] network-agent: Remove "Show password" switch While the ability to show the password can be useful at times, the existing implementation is problematic: 1) The use of a switch is wrong (as even noted in a code comment). 2) It is inconsistent with any other password dialog (login screen, polkit). In lack of a properly designed solution (for all password dialogs), the designers agreed to remove the switch for now. https://bugzilla.gnome.org/show_bug.cgi?id=658948 --- data/theme/gnome-shell.css | 8 -------- js/ui/networkAgent.js | 28 ++++------------------------ 2 files changed, 4 insertions(+), 32 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 9072212fe..b9d22cba1 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -1925,14 +1925,6 @@ StTooltip StLabel { padding-bottom: 8px; } -.network-dialog-show-password-checkbox { - padding-top: 5px; - padding-bottom: 5px; - font-size: 10pt; - color: white; - spacing: 10px; -} - .network-dialog-secret-table { spacing-rows: 15px; } diff --git a/js/ui/networkAgent.js b/js/ui/networkAgent.js index f5c952456..ac0b880f8 100644 --- a/js/ui/networkAgent.js +++ b/js/ui/networkAgent.js @@ -127,34 +127,14 @@ NetworkSecretDialog.prototype = { } else secret.valid = true; - secretTable.add(label, { row: pos, col: 0, x_align: St.Align.START, y_align: St.Align.START }); + secretTable.add(label, { row: pos, col: 0, x_expand: false, x_fill: true, x_align: St.Align.START, y_align: St.Align.START }); secretTable.add(secret.entry, { row: pos, col: 1, x_expand: true, x_fill: true, y_align: St.Align.END }); pos++; - if (secret.password) { + if (secret.password) secret.entry.clutter_text.set_password_char('\u25cf'); - - // FIXME: need a real checkbox here - let button = new St.Button({ button_mask: St.ButtonMask.ONE, - can_focus: true }); - let checkbox = new St.BoxLayout({ vertical: false, - style_class: 'network-dialog-show-password-checkbox' - }); - let _switch = new PopupMenu.Switch(false); - checkbox.add(_switch.actor); - checkbox.add(new St.Label({ text: _("Show password") }), { expand: true }); - button.connect('clicked', function() { - _switch.toggle(); - if (_switch.state) - secret.entry.clutter_text.set_password_char(''); - else - secret.entry.clutter_text.set_password_char('\u25cf'); - }); - button.child = checkbox; - secretTable.add(button, { row: pos, col: 1, x_expand: true, x_fill: true, y_fill: true }) - pos++; - } } + messageBox.add(secretTable); this._okButton = { label: _("Connect"), @@ -404,4 +384,4 @@ NetworkAgent.prototype = { this._dialogs[requestId].close(global.get_current_time()); this._dialogs[requestId].destroy(); } -}; \ No newline at end of file +};