From da49c0d63549eab72b6a9033665fa4bfb356aa78 Mon Sep 17 00:00:00 2001 From: Debarshi Ray Date: Thu, 7 Feb 2013 16:04:37 +0100 Subject: [PATCH] apps-menu: Clean up mark up handling and set label_actor Get rid of fixMarkup, which turns & into &, so that we need to again set use_markup. https://bugzilla.gnome.org/show_bug.cgi?id=693334 --- extensions/apps-menu/extension.js | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js index fd9c590f..e6ab62d5 100644 --- a/extensions/apps-menu/extension.js +++ b/extensions/apps-menu/extension.js @@ -27,19 +27,6 @@ const appSys = Shell.AppSystem.get_default(); const APPLICATION_ICON_SIZE = 32; const MENU_HEIGHT_OFFSET = 132; -function fixMarkup(text, allowMarkup) { - if (allowMarkup) { - let _text = text.replace(/&(?!amp;|quot;|apos;|lt;|gt;)/g, '&'); - _text = _text.replace(/<(?!\/?[biu]>)/g, '<'); - try { - Pango.parse_markup(_text, -1, ''); - return _text; - } catch (e) { - } - } - return GLib.markup_escape_text(text, -1); -} - const ActivitiesMenuItem = new Lang.Class({ Name: 'ActivitiesMenuItem', Extends: PopupMenu.PopupBaseMenuItem, @@ -69,8 +56,9 @@ const ApplicationMenuItem = new Lang.Class({ let icon = this._app.create_icon_texture(APPLICATION_ICON_SIZE); this.addActor(icon); - let appName = fixMarkup(this._app.get_name()); - this.addActor(new St.Label({ text: appName })); + let appLabel = new St.Label({ text: app.get_name() }); + this.addActor(appLabel); + this.actor.label_actor = appLabel; }, activate: function(event) {