[gnome-shell] authPrompt: Use placeholder label to avoid layout changes



commit 0d766dcf701a7051af502c82bdce82fc05629a15
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Feb 14 21:10:04 2020 +0100

    authPrompt: Use placeholder label to avoid layout changes
    
    We don't want to show a caps-lock warning when showing a non-password
    entry, but we also don't want the layout to jump when changing the
    label's visibility.
    
    Achieve that by inserting an empty placeholder label that we can
    show whenever the caps-lock warning is hidden.
    
    https://gitlab.gnome.org/GNOME/gnome-shell/issues/2215

 js/gdm/authPrompt.js | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/js/gdm/authPrompt.js b/js/gdm/authPrompt.js
index 6edb2694a5..9a8cf44bf5 100644
--- a/js/gdm/authPrompt.js
+++ b/js/gdm/authPrompt.js
@@ -85,12 +85,19 @@ var AuthPrompt = GObject.registerClass({
 
         this._initEntryRow();
 
+        let capsLockPlaceholder = new St.Label();
+        this.add_child(capsLockPlaceholder);
+
         this._capsLockWarningLabel = new ShellEntry.CapsLockWarning({
             x_expand: true,
             x_align: Clutter.ActorAlign.CENTER,
         });
         this.add_child(this._capsLockWarningLabel);
 
+        this._capsLockWarningLabel.bind_property('visible',
+            capsLockPlaceholder, 'visible',
+            GObject.BindingFlags.SYNC_CREATE | GObject.BindingFlags.INVERT_BOOLEAN);
+
         this._message = new St.Label({
             opacity: 0,
             styleClass: 'login-dialog-message',


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