]> git.0d.be Git - empathy.git/commitdiff
set separators between contacts
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Mon, 21 May 2012 07:49:26 +0000 (09:49 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 14 Jun 2012 07:21:47 +0000 (09:21 +0200)
libempathy-gtk/empathy-roster-view.c

index 21fabd4f932bc0c8ef224e537641a128a6a187a8..0e7bf51f43f94d7b41e91e994c4d6f8fafa216b8 100644 (file)
@@ -144,6 +144,26 @@ roster_view_sort (EmpathyRosterItem *a,
   return g_ascii_strcasecmp (alias_a, alias_b);
 }
 
+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)
 {
@@ -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