extensionPrefs: Use a single line for description
The current fixed two-line label requires a custom widget, which make moving to a widget template harder. As the description will soon move elsewhere anyway, just go back to a single line with a standard label for now. https://gitlab.gnome.org/GNOME/gnome-shell/issues/1968
This commit is contained in:
parent
8795668c41
commit
5b92e3a9a8
@ -471,16 +471,6 @@ var Expander = GObject.registerClass({
|
||||
}
|
||||
});
|
||||
|
||||
var DescriptionLabel = GObject.registerClass(
|
||||
class DescriptionLabel extends Gtk.Label {
|
||||
vfunc_get_preferred_height_for_width(width) {
|
||||
// Hack: Request the maximum height allowed by the line limit
|
||||
if (this.lines > 0)
|
||||
return super.vfunc_get_preferred_height_for_width(0);
|
||||
return super.vfunc_get_preferred_height_for_width(width);
|
||||
}
|
||||
});
|
||||
|
||||
var ExtensionRow = GObject.registerClass(
|
||||
class ExtensionRow extends Gtk.ListBoxRow {
|
||||
_init(extension) {
|
||||
@ -552,10 +542,13 @@ class ExtensionRow extends Gtk.ListBoxRow {
|
||||
vbox.add(label);
|
||||
|
||||
let desc = this._extension.metadata.description.split('\n')[0];
|
||||
label = new DescriptionLabel({ label: desc, wrap: true, lines: 2,
|
||||
label = new Gtk.Label({
|
||||
label: desc,
|
||||
ellipsize: Pango.EllipsizeMode.END,
|
||||
max_width_chars: 60,
|
||||
xalign: 0, yalign: 0 });
|
||||
xalign: 0,
|
||||
yalign: 0,
|
||||
});
|
||||
vbox.add(label);
|
||||
|
||||
let button = new Gtk.Button({ valign: Gtk.Align.CENTER,
|
||||
|
Loading…
Reference in New Issue
Block a user