Commit b9fba54b authored by Debarshi Ray's avatar Debarshi Ray

apps-menu: Prevent the ApplicationMenuItem from becoming too wide

PopupMenu.PopupBaseMenuItem uses the natural width of its children to
set its own minimum and natural widths. We don't want that because
some of our children can be too wide. So, we override it.

We also set the span and expand parameters of the label to -1 and true
respectively. Otherwise we won't get to see the "...".

https://bugzilla.gnome.org/show_bug.cgi?id=693282
parent f187f47c
......@@ -57,7 +57,7 @@ const ApplicationMenuItem = new Lang.Class({
this.addActor(icon);
let appLabel = new St.Label({ text: app.get_name() });
this.addActor(appLabel);
this.addActor(appLabel, { span: -1, expand: true });
this.actor.label_actor = appLabel;
},
......@@ -72,6 +72,10 @@ const ApplicationMenuItem = new Lang.Class({
if (active)
this._button.scrollToButton(this);
this.parent(active, params);
},
_getPreferredWidth: function(actor, forHeight, alloc) {
alloc.min_size = alloc.natural_size = -1;
}
});
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment