js: Use StPasswordEntry for password entry fields
Use the new StPasswordEntry for password entry fields and remove all direct handling of clutter text of the entry via clutter_text_set_password_char to show/hide the password text. StPasswordEntry will provides a peek-password-icon which will allow to show/hide the password present in the field to the user in subsequent commits. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/619
This commit is contained in:
@@ -54,10 +54,17 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
|
||||
let reactive = secret.key != null;
|
||||
|
||||
secret.entry = new St.Entry({ style_class: 'prompt-dialog-password-entry',
|
||||
text: secret.value, can_focus: reactive,
|
||||
reactive,
|
||||
x_expand: true });
|
||||
let entryParams = {
|
||||
style_class: 'prompt-dialog-password-entry',
|
||||
text: secret.value,
|
||||
can_focus: reactive,
|
||||
reactive,
|
||||
x_expand: true,
|
||||
};
|
||||
if (secret.password)
|
||||
secret.entry = new St.PasswordEntry(entryParams);
|
||||
else
|
||||
secret.entry = new St.Entry(entryParams);
|
||||
ShellEntry.addContextMenu(secret.entry,
|
||||
{ isPassword: secret.password });
|
||||
|
||||
@@ -93,9 +100,6 @@ class NetworkSecretDialog extends ModalDialog.ModalDialog {
|
||||
layout.attach(secret.entry, 1, pos, 1, 1);
|
||||
}
|
||||
pos++;
|
||||
|
||||
if (secret.password)
|
||||
secret.entry.clutter_text.set_password_char('\u25cf');
|
||||
}
|
||||
|
||||
contentBox.messageBox.add(secretTable);
|
||||
|
Reference in New Issue
Block a user