[gnome-shell/uajain/adapt-user-avatar: 3/7] authPrompt: Move cancel button and cog to a single row



commit 6808beb9e6ac5c702a2673891874502a60fbe232
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Dec 6 12:20:27 2019 +0530

    authPrompt: Move cancel button and cog to a single row

 js/gdm/authPrompt.js | 76 +++++++++++++++++++++++++---------------------------
 1 file changed, 37 insertions(+), 39 deletions(-)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 0d4af0f7d9..0b5cbf8725 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -98,23 +98,8 @@ var AuthPrompt = GObject.registerClass({
         });
 
         this.add_child(this._label);
-        this._entry = new St.Entry({
-            style_class: 'login-dialog-prompt-entry',
-            can_focus: true,
-            x_expand: false,
-            y_expand: true,
-        });
-        ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE });
-
-        this.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._initEntryRow();
 
         this._message = new St.Label({
             opacity: 0,
@@ -126,26 +111,6 @@ var AuthPrompt = GObject.registerClass({
         this._message.clutter_text.line_wrap = true;
         this._message.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
         this.add_child(this._message);
-
-        this._buttonBox = new St.BoxLayout({
-            style_class: 'login-dialog-button-box',
-            vertical: false,
-            y_align: Clutter.ActorAlign.END,
-        });
-        this.add_child(this._buttonBox);
-
-        this._defaultButtonWell = new St.Widget({
-            layout_manager: new Clutter.BinLayout(),
-            x_align: Clutter.ActorAlign.END,
-            y_align: Clutter.ActorAlign.CENTER,
-        });
-
-        this._initButtons();
-
-        this._spinner = new Animation.Spinner(DEFAULT_BUTTON_WELL_ICON_SIZE);
-        this._spinner.opacity = 0;
-        this._spinner.show();
-        this._defaultButtonWell.add_child(this._spinner);
     }
 
     _onDestroy() {
@@ -159,7 +124,13 @@ var AuthPrompt = GObject.registerClass({
         return Clutter.EVENT_PROPAGATE;
     }
 
-    _initButtons() {
+    _initEntryRow() {
+        let mainBox = new St.BoxLayout({
+            style_class: 'login-dialog-button-box',
+            vertical: false,
+        });
+        this.add_child(mainBox);
+
         this.cancelButton = new St.Button({
             style_class: 'modal-dialog-button button',
             button_mask: St.ButtonMask.ONE | St.ButtonMask.THREE,
@@ -171,9 +142,36 @@ var AuthPrompt = GObject.registerClass({
             y_align: Clutter.ActorAlign.END,
         });
         this.cancelButton.connect('clicked', () => this.cancel());
-        this._buttonBox.add_child(this.cancelButton);
+        mainBox.add_child(this.cancelButton);
+
+        this._entry = new St.Entry({
+            style_class: 'login-dialog-prompt-entry',
+            can_focus: true,
+            x_expand: false,
+            y_expand: true,
+        });
+        ShellEntry.addContextMenu(this._entry, { isPassword: true, actionMode: Shell.ActionMode.NONE });
+
+        mainBox.add_child(this._entry);
 
-        this._buttonBox.add_child(this._defaultButtonWell);
+        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(),
+            x_align: Clutter.ActorAlign.END,
+            y_align: Clutter.ActorAlign.CENTER,
+        });
+        mainBox.add_child(this._defaultButtonWell);
+
+        this._spinner = new Animation.Spinner(DEFAULT_BUTTON_WELL_ICON_SIZE);
+        this._spinner.opacity = 0;
+        this._spinner.show();
+        this._defaultButtonWell.add_child(this._spinner);
     }
 
     _onAskQuestion(verifier, serviceName, question, passwordChar) {


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