aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-09 23:31:59 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2010-03-15 16:28:41 +0800
commit28202c4333c27f360d9298427a9f196954cf8f9f (patch)
tree83aa7b4fb5b17ab26daa39e06acac82579b337d7 /libempathy-gtk
parentd8d32209c69c82ebec704126c461abb9e39e1b8f (diff)
downloadgsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar.gz
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar.bz2
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar.lz
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar.xz
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.tar.zst
gsoc2013-empathy-28202c4333c27f360d9298427a9f196954cf8f9f.zip
Display icon near the favorite fake group
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-contact-list-view.c53
1 files changed, 53 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-contact-list-view.c b/libempathy-gtk/empathy-contact-list-view.c
index 705494e4a..5b6686896 100644
--- a/libempathy-gtk/empathy-contact-list-view.c
+++ b/libempathy-gtk/empathy-contact-list-view.c
@@ -879,6 +879,43 @@ contact_list_view_pixbuf_cell_data_func (GtkTreeViewColumn *tree_column,
}
static void
+contact_list_view_group_icon_cell_data_func (GtkTreeViewColumn *tree_column,
+ GtkCellRenderer *cell,
+ GtkTreeModel *model,
+ GtkTreeIter *iter,
+ EmpathyContactListView *view)
+{
+ GdkPixbuf *pixbuf = NULL;
+ gboolean is_group;
+ gchar *name;
+
+ gtk_tree_model_get (model, iter,
+ EMPATHY_CONTACT_LIST_STORE_COL_IS_GROUP, &is_group,
+ EMPATHY_CONTACT_LIST_STORE_COL_NAME, &name,
+ -1);
+
+ if (!is_group)
+ goto out;;
+
+ if (tp_strdiff (name, EMPATHY_CONTACT_LIST_STORE_FAVORITE))
+ goto out;;
+
+ pixbuf = empathy_pixbuf_from_icon_name ("emblem-favorite",
+ GTK_ICON_SIZE_MENU);
+
+out:
+ g_object_set (cell,
+ "visible", pixbuf != NULL,
+ "pixbuf", pixbuf,
+ NULL);
+
+ if (pixbuf != NULL)
+ g_object_unref (pixbuf);
+
+ g_free (name);
+}
+
+static void
contact_list_view_audio_call_cell_data_func (
GtkTreeViewColumn *tree_column,
GtkCellRenderer *cell,
@@ -1115,6 +1152,22 @@ contact_list_view_setup (EmpathyContactListView *view)
"visible", FALSE,
NULL);
+ /* Group icon */
+ cell = gtk_cell_renderer_pixbuf_new ();
+ gtk_tree_view_column_pack_start (col, cell, FALSE);
+ gtk_tree_view_column_set_cell_data_func (
+ col, cell,
+ (GtkTreeCellDataFunc) contact_list_view_group_icon_cell_data_func,
+ view, NULL);
+
+ g_object_set (cell,
+ "xpad", 0,
+ "ypad", 0,
+ "visible", FALSE,
+ "width", 16,
+ "height", 16,
+ NULL);
+
/* Name */
cell = empathy_cell_renderer_text_new ();
gtk_tree_view_column_pack_start (col, cell, TRUE);