From b9fba54b9fb583d38a392185ae12eab0ed226146 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 7 Feb 2013 15:59:25 +0100 Subject: [PATCH] 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 --- extensions/apps-menu/extension.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index e6ab62d5..dcecfb1f 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -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; } });