From 6cd0c3f9653fd938b6e3275ec0684efc50ac23c8 Mon Sep 17 00:00:00 2001 From: Georges Basile Stavracas Neto Date: Sat, 12 Oct 2019 17:58:55 -0300 Subject: [PATCH] authPrompt: Move cancel button and cog to a single row Move the cancel button and the user well actors (the cog menu and the spinner) to a single row. Ultimately the user well will be splitted out into a different place, but moving it now at least gives some visual consistency. --- js/gdm/authPrompt.js | 79 ++++++++++++++++++-------------------------- 1 file changed, 32 insertions(+), 47 deletions(-) diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js index 52c5234e2..338751605 100644 --- a/js/gdm/authPrompt.js +++ b/js/gdm/authPrompt.js @@ -90,15 +90,41 @@ var AuthPrompt = class { x_fill: false, y_fill: true, x_align: St.Align.START }); + + this._initEntryRow(); + + this._message = new St.Label({ opacity: 0, + styleClass: 'login-dialog-message' }); + this._message.clutter_text.line_wrap = true; + this._message.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; + this.actor.add(this._message, { x_fill: false, x_align: St.Align.START, y_align: St.Align.START }); + } + + _onDestroy() { + this._userVerifier.destroy(); + this._userVerifier = null; + } + + _initEntryRow() { + let mainBox = new St.BoxLayout({ + style_class: 'login-dialog-button-box', + vertical: false, + }); + this.actor.add_child(mainBox); + + this.cancelButton = new St.Button({ style_class: 'modal-dialog-button button', + button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, + reactive: true, + can_focus: true, + label: _("Cancel") }); + this.cancelButton.connect('clicked', () => this.cancel()); + mainBox.add_child(this.cancelButton); + this._entry = new St.Entry({ style_class: 'login-dialog-prompt-entry', can_focus: true }); ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE }); - this.actor.add(this._entry, - { expand: true, - x_fill: true, - y_fill: false, - x_align: St.Align.START }); + mainBox.add_child(this._entry); this._entry.grab_key_focus(); this._entry.clutter_text.connect('activate', () => this.emit('next')); @@ -107,23 +133,9 @@ var AuthPrompt = class { this._fadeOutMessage(); }); - this._message = new St.Label({ opacity: 0, - styleClass: 'login-dialog-message' }); - this._message.clutter_text.line_wrap = true; - this._message.clutter_text.ellipsize = Pango.EllipsizeMode.NONE; - this.actor.add(this._message, { x_fill: false, x_align: St.Align.START, y_align: St.Align.START }); - - this._buttonBox = new St.BoxLayout({ style_class: 'login-dialog-button-box', - vertical: false }); - this.actor.add(this._buttonBox, - { expand: true, - x_align: St.Align.MIDDLE, - y_align: St.Align.END }); - this._defaultButtonWell = new St.Widget({ layout_manager: new Clutter.BinLayout() }); this._defaultButtonWellActor = null; - - this._initButtons(); + mainBox.add_child(this._defaultButtonWell); this._spinner = new Animation.Spinner(DEFAULT_BUTTON_WELL_ICON_SIZE); this._spinner.actor.opacity = 0; @@ -131,33 +143,6 @@ var AuthPrompt = class { this._defaultButtonWell.add_child(this._spinner.actor); } - _onDestroy() { - this._userVerifier.destroy(); - this._userVerifier = null; - } - - _initButtons() { - this.cancelButton = new St.Button({ style_class: 'modal-dialog-button button', - button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE, - reactive: true, - can_focus: true, - label: _("Cancel") }); - this.cancelButton.connect('clicked', () => this.cancel()); - this._buttonBox.add(this.cancelButton, - { expand: false, - x_fill: false, - y_fill: false, - x_align: St.Align.START, - y_align: St.Align.END }); - - this._buttonBox.add(this._defaultButtonWell, - { expand: true, - x_fill: false, - y_fill: false, - x_align: St.Align.END, - y_align: St.Align.MIDDLE }); - } - _onAskQuestion(verifier, serviceName, question, passwordChar) { if (this._queryingService) this.clear();