diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-08-29 17:49:48 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2013-09-04 22:31:14 +0800 |
commit | a2b853f3f87579d32a835c22bfcdedeab965df8c (patch) | |
tree | 56d31af5fa7ac1b69f21cfaae82db5d20023daa9 | |
parent | 0e9e3cf651969dc4b4e82ddade02a02ca0ba1e5d (diff) | |
download | gsoc2013-empathy-a2b853f3f87579d32a835c22bfcdedeab965df8c.tar.gz gsoc2013-empathy-a2b853f3f87579d32a835c22bfcdedeab965df8c.tar.zst gsoc2013-empathy-a2b853f3f87579d32a835c22bfcdedeab965df8c.zip |
roster-group: inherit from GtkListBoxRow
Need to be pack in a GtkListBox.
https://bugzilla.gnome.org/show_bug.cgi?id=706988
-rw-r--r-- | libempathy-gtk/empathy-roster-group.c | 13 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-group.h | 7 | ||||
-rw-r--r-- | libempathy-gtk/empathy-roster-view.c | 6 |
3 files changed, 17 insertions, 9 deletions
diff --git a/libempathy-gtk/empathy-roster-group.c b/libempathy-gtk/empathy-roster-group.c index 9ca53a8e9..753655ab5 100644 --- a/libempathy-gtk/empathy-roster-group.c +++ b/libempathy-gtk/empathy-roster-group.c @@ -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); } diff --git a/libempathy-gtk/empathy-roster-group.h b/libempathy-gtk/empathy-roster-group.h index 405455bf5..d5ad70e57 100644 --- a/libempathy-gtk/empathy-roster-group.h +++ b/libempathy-gtk/empathy-roster-group.h @@ -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); diff --git a/libempathy-gtk/empathy-roster-view.c b/libempathy-gtk/empathy-roster-view.c index bf2a4697e..595681f8d 100644 --- a/libempathy-gtk/empathy-roster-view.c +++ b/libempathy-gtk/empathy-roster-view.c @@ -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; } } |