dialog: Really set ellipsize mode in subtitle and body

Dialog's subtitle or body could not be properly wrapped, while it's ellipsized
when the text's width doesn't exceed the container size.

Clutter text has an `ellipsize` property, however in dialog's subtitle and body
we have been setting the `ellipsize-mode` property to Pango.EllipsizeMode.NONE
that is not present in the underlying GObject.

Not being an error in javascript, gjs didn't warn us about this, while at the
same time the St.Label's default Pango.EllipsizeMode.END was used.

Fixes https://gitlab.gnome.org/GNOME/gnome-shell/issues/922

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/531
This commit is contained in:
Marco Trevisan (Treviño) 2019-05-03 15:27:13 -05:00
parent 1ebbd7c768
commit 3121c9aa29

View File

@ -175,7 +175,7 @@ var MessageDialogContent = GObject.registerClass({
this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`); this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`);
}); });
let textProps = { ellipsize_mode: Pango.EllipsizeMode.NONE, let textProps = { ellipsize: Pango.EllipsizeMode.NONE,
line_wrap: true }; line_wrap: true };
Object.assign(this._subtitle.clutter_text, textProps); Object.assign(this._subtitle.clutter_text, textProps);
Object.assign(this._body.clutter_text, textProps); Object.assign(this._body.clutter_text, textProps);