From 1f50f4658d71995bbc3db873a47b4ba09b34d0e8 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Mon, 26 Aug 2013 15:43:27 -0400 Subject: [PATCH] unlockDialog: Remove clutter constraints from the code These cause annoying allocation cycle warnings, and it's simpler to just express our desired layout in terms of nested containers. Adapt the theme to match as well. https://bugzilla.gnome.org/show_bug.cgi?id=706843 --- data/theme/gnome-shell.css | 8 -------- js/ui/unlockDialog.js | 10 ++++++---- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css index 822401d1c..683e3034e 100644 --- a/data/theme/gnome-shell.css +++ b/data/theme/gnome-shell.css @@ -2258,14 +2258,6 @@ StScrollBar StButton#vhandle:active { /* Reset border and background */ border: none; background-color: transparent; - - padding-bottom: 80px; - padding-top: 80px; - - border-radius: 16px; - min-height: 150px; - max-height: 700px; - min-width: 350px; } .login-dialog-button-box { diff --git a/js/ui/unlockDialog.js b/js/ui/unlockDialog.js index b0d342b9e..d43df839a 100644 --- a/js/ui/unlockDialog.js +++ b/js/ui/unlockDialog.js @@ -34,6 +34,7 @@ const UnlockDialog = new Lang.Class({ _init: function(parentActor) { this.actor = new St.Widget({ accessible_role: Atk.Role.WINDOW, style_class: 'login-dialog', + layout_manager: new Clutter.BoxLayout(), visible: false }); this.actor.add_constraint(new Layout.MonitorConstraint({ primary: true })); @@ -43,11 +44,12 @@ const UnlockDialog = new Lang.Class({ this._userName = GLib.get_user_name(); this._user = this._userManager.get_user(this._userName); - this._promptBox = new St.BoxLayout({ vertical: true }); + this._promptBox = new St.BoxLayout({ vertical: true, + x_align: Clutter.ActorAlign.CENTER, + y_align: Clutter.ActorAlign.CENTER, + x_expand: true, + y_expand: true }); this.actor.add_child(this._promptBox); - this._promptBox.add_constraint(new Clutter.AlignConstraint({ source: this.actor, - align_axis: Clutter.AlignAxis.BOTH, - factor: 0.5 })); this._authPrompt = new AuthPrompt.AuthPrompt(new Gdm.Client(), AuthPrompt.AuthPromptMode.UNLOCK_ONLY); this._authPrompt.connect('failed', Lang.bind(this, this._fail));