loginDialog: handle really long messages better

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.
This commit is contained in:
Ray Strode 2013-06-19 14:01:52 -04:00
parent b188d57609
commit d985477a9d
2 changed files with 19 additions and 2 deletions

View File

@ -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,

View File

@ -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',