aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-theme-adium.c
diff options
context:
space:
mode:
authorDanielle Madeley <danielle.madeley@collabora.co.uk>2011-05-20 11:02:45 +0800
committerDanielle Madeley <danielle.madeley@collabora.co.uk>2011-06-14 00:04:03 +0800
commit04986511e537b4a5d90cc13f63580984e6fa1318 (patch)
tree122f4bff751f71676c7a38abd9045e0990a5a1cd /libempathy-gtk/empathy-theme-adium.c
parent6b13df746bc564a8ee72d1575315c007100262ce (diff)
downloadgsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar.gz
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar.bz2
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar.lz
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar.xz
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.tar.zst
gsoc2013-empathy-04986511e537b4a5d90cc13f63580984e6fa1318.zip
Add an icon to edited messages
Currently this is using "format-text-direction-ltr" which is a crappy choice. We should ask for a better icon. Also, this should really be implemented as a class, so that the icon can change with the theme. Or be made part of the Adium theme, or something. Basically this is kludgey.
Diffstat (limited to 'libempathy-gtk/empathy-theme-adium.c')
-rw-r--r--libempathy-gtk/empathy-theme-adium.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index 14a399803..a4df12d58 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -1036,6 +1036,7 @@ theme_adium_edit_message (EmpathyChatView *view,
WebKitDOMElement *span;
gchar *id, *parsed_body;
gchar *tooltip, *timestamp;
+ GtkIconInfo *icon_info;
GError *error = NULL;
if (priv->pages_loading != 0) {
@@ -1088,6 +1089,33 @@ theme_adium_edit_message (EmpathyChatView *view,
g_free (tooltip);
g_free (timestamp);
+ /* mark this message as edited */
+ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (),
+ EMPATHY_IMAGE_EDIT_MESSAGE, 16, 0);
+
+ if (icon_info != NULL) {
+ /* set the icon as a background image using CSS
+ * FIXME: the icon won't update in response to theme changes */
+ gchar *style = g_strdup_printf (
+ "background-image:url('%s');"
+ "background-repeat:no-repeat;"
+ "background-position:left center;"
+ "padding-left:19px;", /* 16px icon + 3px padding */
+ gtk_icon_info_get_filename (icon_info));
+
+ webkit_dom_element_set_attribute (span, "style", style, &error);
+
+ if (error != NULL) {
+ DEBUG ("Error setting element style: %s",
+ error->message);
+ g_clear_error (&error);
+ /* not fatal */
+ }
+
+ g_free (style);
+ gtk_icon_info_free (icon_info);
+ }
+
goto finally;
except: