aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-roster-view.c
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-05-21 15:49:26 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-06-14 15:21:47 +0800
commitf25c42cb2412ceb7d0c5374fc8ce4918c01a6a53 (patch)
treea3bbfb0ef3793187c7232b0b3ac19612dbdbaa43 /libempathy-gtk/empathy-roster-view.c
parent80766fff0ac533ddfa01d609aa89e44b6f4dfe78 (diff)
downloadgsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar.gz
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar.bz2
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar.lz
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar.xz
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.tar.zst
gsoc2013-empathy-f25c42cb2412ceb7d0c5374fc8ce4918c01a6a53.zip
set separators between contacts
Diffstat (limited to 'libempathy-gtk/empathy-roster-view.c')
-rw-r--r--libempathy-gtk/empathy-roster-view.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c
index 21fabd4f9..0e7bf51f4 100644
--- a/libempathy-gtk/empathy-roster-view.c
+++ b/libempathy-gtk/empathy-roster-view.c
@@ -145,6 +145,26 @@ roster_view_sort (EmpathyRosterItem *a,
}
static void
+update_separator (GtkWidget **separator,
+ GtkWidget *child,
+ GtkWidget *before,
+ gpointer user_data)
+{
+ if (before == NULL)
+ {
+ /* No separator before the first row */
+ g_clear_object (separator);
+ return;
+ }
+
+ if (*separator != NULL)
+ return;
+
+ *separator = gtk_separator_new (GTK_ORIENTATION_HORIZONTAL);
+ g_object_ref_sink (*separator);
+}
+
+static void
empathy_roster_view_constructed (GObject *object)
{
EmpathyRosterView *self = EMPATHY_ROSTER_VIEW (object);
@@ -172,6 +192,9 @@ empathy_roster_view_constructed (GObject *object)
egg_list_box_set_sort_func (EGG_LIST_BOX (self),
(GCompareDataFunc) roster_view_sort, self, NULL);
+
+ egg_list_box_set_separator_funcs (EGG_LIST_BOX (self), update_separator,
+ self, NULL);
}
static void