Commit a2b853f3 authored by Guillaume Desmottes's avatar Guillaume Desmottes

roster-group: inherit from GtkListBoxRow

Need to be pack in a GtkListBox.

https://bugzilla.gnome.org/show_bug.cgi?id=706988
parent 0e9e3cf6
......@@ -3,7 +3,7 @@
#include <telepathy-glib/telepathy-glib.h>
G_DEFINE_TYPE (EmpathyRosterGroup, empathy_roster_group, GTK_TYPE_EXPANDER)
G_DEFINE_TYPE (EmpathyRosterGroup, empathy_roster_group, GTK_TYPE_LIST_BOX_ROW)
enum
{
......@@ -116,7 +116,7 @@ empathy_roster_group_constructed (GObject *object)
gtk_widget_show_all (box);
gtk_expander_set_label_widget (GTK_EXPANDER (self), box);
gtk_expander_set_label_widget (self->expander, box);
}
static void
......@@ -181,6 +181,13 @@ empathy_roster_group_init (EmpathyRosterGroup *self)
EMPATHY_TYPE_ROSTER_GROUP, EmpathyRosterGroupPriv);
self->priv->widgets = g_hash_table_new (NULL, NULL);
self->expander = GTK_EXPANDER (gtk_expander_new (NULL));
gtk_expander_set_use_markup (self->expander, TRUE);
gtk_expander_set_expanded (self->expander, TRUE);
gtk_widget_show (GTK_WIDGET (self->expander));
gtk_container_add (GTK_CONTAINER (self), GTK_WIDGET (self->expander));
}
GtkWidget *
......@@ -190,8 +197,6 @@ empathy_roster_group_new (const gchar *name,
return g_object_new (EMPATHY_TYPE_ROSTER_GROUP,
"name", name,
"icon", icon,
"use-markup", TRUE,
"expanded", TRUE,
NULL);
}
......
......@@ -12,14 +12,17 @@ typedef struct _EmpathyRosterGroupPriv EmpathyRosterGroupPriv;
struct _EmpathyRosterGroupClass
{
/*<private>*/
GtkExpanderClass parent_class;
GtkListBoxRowClass parent_class;
};
struct _EmpathyRosterGroup
{
/*<private>*/
GtkExpander parent;
GtkListBoxRow parent;
EmpathyRosterGroupPriv *priv;
/*<public>*/
GtkExpander *expander;
};
GType empathy_roster_group_get_type (void);
......
......@@ -211,7 +211,7 @@ group_expanded_cb (EmpathyRosterGroup *group,
g_list_free (widgets);
empathy_contact_group_set_expanded (empathy_roster_group_get_name (group),
gtk_expander_get_expanded (GTK_EXPANDER (group)));
gtk_expander_get_expanded (group->expander));
}
static EmpathyRosterGroup *
......@@ -238,7 +238,7 @@ ensure_roster_group (EmpathyRosterView *self,
else
roster_group = empathy_roster_group_new (group, NULL);
gtk_expander_set_expanded (GTK_EXPANDER (roster_group),
gtk_expander_set_expanded (EMPATHY_ROSTER_GROUP (roster_group)->expander,
empathy_contact_group_get_expanded (group));
g_signal_connect (roster_group, "notify::expanded",
......@@ -900,7 +900,7 @@ filter_contact (EmpathyRosterView *self,
{
/* When searching, always display even if the group is closed */
if (!is_searching (self) &&
!gtk_expander_get_expanded (GTK_EXPANDER (group)))
!gtk_expander_get_expanded (group->expander))
displayed = FALSE;
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment