[gnome-shell-extensions] apps-menu: Clean up mark up handling and set label_actor
- From: Debarshi Ray <debarshir src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell-extensions] apps-menu: Clean up mark up handling and set label_actor
- Date: Fri, 8 Feb 2013 12:30:04 +0000 (UTC)
commit da49c0d63549eab72b6a9033665fa4bfb356aa78
Author: Debarshi Ray <debarshir gnome org>
Date: Thu Feb 7 16:04:37 2013 +0100
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 files changed, 3 insertions(+), 15 deletions(-)
---
diff --git a/extensions/apps-menu/extension.js b/extensions/apps-menu/extension.js
index fd9c590..e6ab62d 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) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]