aboutsummaryrefslogtreecommitdiffstats
path: root/src/empathy-chat-window.c
diff options
context:
space:
mode:
authorJonny Lamb <jonny.lamb@collabora.co.uk>2008-07-08 18:58:19 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-07-08 18:58:19 +0800
commitb09d614f327b2eb13d2cbb8a39df9c1b5f7310d9 (patch)
treea43b8ce20948715487476326ca4be6e75bf4c764 /src/empathy-chat-window.c
parent93978582b8a48175d4721b3d8fddce0d6d55b4fc (diff)
downloadgsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar.gz
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar.bz2
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar.lz
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar.xz
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.tar.zst
gsoc2013-empathy-b09d614f327b2eb13d2cbb8a39df9c1b5f7310d9.zip
Added support for the chat window to show the avatar as the icon. Fixes bug #526892 (Jonny Lamb)
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk> svn path=/trunk/; revision=1205
Diffstat (limited to 'src/empathy-chat-window.c')
-rw-r--r--src/empathy-chat-window.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 8be64a3d8..7a993d6bf 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -287,6 +287,9 @@ chat_window_update (EmpathyChatWindow *window)
gint page_num;
const gchar *name;
guint n_chats;
+ GdkPixbuf *icon;
+ EmpathyContact *remote_contact;
+ gboolean avatar_in_icon;
/* Get information */
page_num = gtk_notebook_get_current_page (GTK_NOTEBOOK (priv->notebook));
@@ -323,7 +326,18 @@ chat_window_update (EmpathyChatWindow *window)
gtk_window_set_icon_name (GTK_WINDOW (priv->dialog),
EMPATHY_IMAGE_MESSAGE);
} else {
- gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_CHAT_AVATAR_IN_ICON,
+ &avatar_in_icon);
+
+ if (n_chats == 1 && avatar_in_icon) {
+ remote_contact = empathy_chat_get_remote_contact (priv->current_chat);
+ icon = empathy_pixbuf_avatar_from_contact_scaled (remote_contact, 0, 0);
+ gtk_window_set_icon (GTK_WINDOW (priv->dialog), icon);
+ g_object_unref (icon);
+ } else {
+ gtk_window_set_icon_name (GTK_WINDOW (priv->dialog), NULL);
+ }
}
}