dialogs: Hide caps lock warning if password entry is hidden
If all password entries in dialogs are hidden, there is either an entry that has visible characters or no entry at all. That means we don't have to show the caps lock warning at all, so hide it. https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/942
This commit is contained in:
parent
59bd2dd1e3
commit
45c5f21f6c
@ -59,6 +59,12 @@ class KeyringDialog extends ModalDialog.ModalDialog {
|
|||||||
let warningBox = new St.BoxLayout({ vertical: true });
|
let warningBox = new St.BoxLayout({ vertical: true });
|
||||||
|
|
||||||
let capsLockWarning = new ShellEntry.CapsLockWarning();
|
let capsLockWarning = new ShellEntry.CapsLockWarning();
|
||||||
|
let syncCapsLockWarningVisibility = () => {
|
||||||
|
capsLockWarning.visible =
|
||||||
|
this.prompt.password_visible || this.prompt.confirm_visible;
|
||||||
|
};
|
||||||
|
this.prompt.connect('notify::password-visible', syncCapsLockWarningVisibility);
|
||||||
|
this.prompt.connect('notify::confirm-visible', syncCapsLockWarningVisibility);
|
||||||
warningBox.add_child(capsLockWarning);
|
warningBox.add_child(capsLockWarning);
|
||||||
|
|
||||||
let warning = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
let warning = new St.Label({ style_class: 'prompt-dialog-error-label' });
|
||||||
|
@ -103,6 +103,9 @@ var AuthenticationDialog = GObject.registerClass({
|
|||||||
let warningBox = new St.BoxLayout({ vertical: true });
|
let warningBox = new St.BoxLayout({ vertical: true });
|
||||||
|
|
||||||
let capsLockWarning = new ShellEntry.CapsLockWarning();
|
let capsLockWarning = new ShellEntry.CapsLockWarning();
|
||||||
|
this._passwordEntry.bind_property('visible',
|
||||||
|
capsLockWarning, 'visible',
|
||||||
|
GObject.BindingFlags.SYNC_CREATE);
|
||||||
warningBox.add_child(capsLockWarning);
|
warningBox.add_child(capsLockWarning);
|
||||||
|
|
||||||
this._errorMessageLabel = new St.Label({
|
this._errorMessageLabel = new St.Label({
|
||||||
|
Loading…
Reference in New Issue
Block a user