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
This commit is contained in:
Debarshi Ray
2013-02-08 13:29:44 +01:00
parent c626cc2a1d
commit da49c0d635
+3 -15
View File
@@ -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, '&lt;');
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) {