[gnome-shell/gbsneto/new-lock-screen: 14/22] authPrompt: Move cancel button and cog to a single row



commit 6cd0c3f9653fd938b6e3275ec0684efc50ac23c8
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Oct 12 17:58:55 2019 -0300

    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 | 77 +++++++++++++++++++++-------------------------------
 1 file changed, 31 insertions(+), 46 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 52c5234e21..338751605c 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -90,45 +90,14 @@ var AuthPrompt = class {
                          x_fill: false,
                          y_fill: true,
                          x_align: St.Align.START });
-        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 });
-
-        this._entry.grab_key_focus();
-        this._entry.clutter_text.connect('activate', () => this.emit('next'));
-        this._entry.clutter_text.connect('text-changed', () => {
-            if (!this._userVerifier.hasPendingMessages)
-                this._fadeOutMessage();
-        });
+        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 });
-
-        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();
-
-        this._spinner = new Animation.Spinner(DEFAULT_BUTTON_WELL_ICON_SIZE);
-        this._spinner.actor.opacity = 0;
-        this._spinner.actor.show();
-        this._defaultButtonWell.add_child(this._spinner.actor);
     }
 
     _onDestroy() {
@@ -136,26 +105,42 @@ var AuthPrompt = class {
         this._userVerifier = null;
     }
 
-    _initButtons() {
+    _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());
-        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 });
+        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 });
+
+        mainBox.add_child(this._entry);
+
+        this._entry.grab_key_focus();
+        this._entry.clutter_text.connect('activate', () => this.emit('next'));
+        this._entry.clutter_text.connect('text-changed', () => {
+            if (!this._userVerifier.hasPendingMessages)
+                this._fadeOutMessage();
+        });
+
+        this._defaultButtonWell = new St.Widget({ layout_manager: new Clutter.BinLayout() });
+        this._defaultButtonWellActor = null;
+        mainBox.add_child(this._defaultButtonWell);
+
+        this._spinner = new Animation.Spinner(DEFAULT_BUTTON_WELL_ICON_SIZE);
+        this._spinner.actor.opacity = 0;
+        this._spinner.actor.show();
+        this._defaultButtonWell.add_child(this._spinner.actor);
     }
 
     _onAskQuestion(verifier, serviceName, question, passwordChar) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]