summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRay Strode <rstrode@redhat.com>2013-06-19 14:01:52 -0400
committerRay Strode <rstrode@redhat.com>2013-06-19 15:52:36 -0400
commitd985477a9d1b1a9ab83a7683be17286b9f478166 (patch)
tree2e86920d6994abeabb7aad8ac054ee07bafdbab1
parentb188d57609ca666cfca13f0de8afdf5f2e7cba7f (diff)
downloadgnome-shell-wip/reorg.tar.gz
loginDialog: handle really long messages betterwip/reorg
Right now if a long message comes in, the whole dialog grows. This commit fixes that by making the label a label of the entire screen, instead of a child of the prompt box. To ensure there's still height allocated for it, this commit introduces a dummy placeholder actor.
-rw-r--r--data/theme/gnome-shell.css3
-rw-r--r--js/ui/auth/loginDialog.js18
2 files changed, 19 insertions, 2 deletions
diff --git a/data/theme/gnome-shell.css b/data/theme/gnome-shell.css
index 13f148e25..3b0703e52 100644
--- a/data/theme/gnome-shell.css
+++ b/data/theme/gnome-shell.css
@@ -2246,6 +2246,7 @@ StScrollBar StButton#vhandle:active {
.login-dialog-prompt-login-hint-message {
font-size: 10.5pt;
+ min-width: 480px;
}
.login-dialog-user-list-view {
@@ -2352,7 +2353,7 @@ StScrollBar StButton#vhandle:active {
}
.login-dialog-prompt-entry {
- width: 25em;
+ width: 480px;
}
.login-dialog-session-list,
diff --git a/js/ui/auth/loginDialog.js b/js/ui/auth/loginDialog.js
index f9329770e..7107c952a 100644
--- a/js/ui/auth/loginDialog.js
+++ b/js/ui/auth/loginDialog.js
@@ -162,7 +162,23 @@ const LoginDialog = new Lang.Class({
x_fill: false });
this._promptMessage = new St.Label({ opacity: 0 });
- this._promptBox.add(this._promptMessage, { x_fill: true });
+ this.actor.add_child(this._promptMessage);
+
+ this._promptMessagePlaceholder = new Clutter.Actor({ width: 1, height: 1 });
+ this._promptBox.add_child(this._promptMessagePlaceholder);
+
+ this._promptMessagePlaceholder.add_constraint(new Clutter.BindConstraint({ source: this._promptMessage,
+ coordinate: Clutter.BindCoordinate.HEIGHT }));
+
+ this._promptMessage.add_constraint(new Clutter.AlignConstraint({ source: this.actor,
+ align_axis: Clutter.AlignAxis.X_AXIS,
+ factor: 0.5 }));
+
+ this._promptMessagePlaceholder.connect("notify::y", Lang.bind(this, function() {
+ let [placeholderX , placeholderY] = this._promptMessagePlaceholder.get_transformed_position();
+ let [actorX, actorY] = this.actor.get_transformed_position();
+ this._promptMessage.y = placeholderY - actorY;
+ }));
this._sessionList = new SessionList.SessionList();
this._sessionList.connect('session-activated',