[empathy] roster-contact: inherit from GtkListBoxRow
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] roster-contact: inherit from GtkListBoxRow
- Date: Thu, 5 Sep 2013 07:10:17 +0000 (UTC)
commit 0e9e3cf651969dc4b4e82ddade02a02ca0ba1e5d
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Wed Sep 4 15:55:33 2013 +0200
roster-contact: inherit from GtkListBoxRow
Need to be pack in a GtkListBox.
https://bugzilla.gnome.org/show_bug.cgi?id=706988
libempathy-gtk/empathy-roster-contact.c | 15 ++++++++-------
libempathy-gtk/empathy-roster-contact.h | 4 ++--
2 files changed, 10 insertions(+), 9 deletions(-)
---
diff --git a/libempathy-gtk/empathy-roster-contact.c b/libempathy-gtk/empathy-roster-contact.c
index 328b512..df57a87 100644
--- a/libempathy-gtk/empathy-roster-contact.c
+++ b/libempathy-gtk/empathy-roster-contact.c
@@ -8,7 +8,7 @@
#include "empathy-ui-utils.h"
#include "empathy-utils.h"
-G_DEFINE_TYPE (EmpathyRosterContact, empathy_roster_contact, GTK_TYPE_ALIGNMENT)
+G_DEFINE_TYPE (EmpathyRosterContact, empathy_roster_contact, GTK_TYPE_LIST_BOX_ROW)
#define AVATAR_SIZE 48
@@ -391,12 +391,16 @@ empathy_roster_contact_class_init (
static void
empathy_roster_contact_init (EmpathyRosterContact *self)
{
- GtkWidget *main_box, *box, *first_line_box;
+ GtkWidget *alig, *main_box, *box, *first_line_box;
GtkStyleContext *context;
self->priv = G_TYPE_INSTANCE_GET_PRIVATE (self,
EMPATHY_TYPE_ROSTER_CONTACT, EmpathyRosterContactPriv);
+ alig = gtk_alignment_new (0.5, 0.5, 1, 1);
+ gtk_widget_show (alig);
+ gtk_alignment_set_padding (GTK_ALIGNMENT (alig), 4, 4, 4, 12);
+
main_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 8);
/* Avatar */
@@ -454,7 +458,8 @@ empathy_roster_contact_init (EmpathyRosterContact *self)
FALSE, FALSE, 0);
gtk_widget_show (self->priv->presence_icon);
- gtk_container_add (GTK_CONTAINER (self), main_box);
+ gtk_container_add (GTK_CONTAINER (self), alig);
+ gtk_container_add (GTK_CONTAINER (alig), main_box);
gtk_widget_show (main_box);
}
@@ -467,10 +472,6 @@ empathy_roster_contact_new (FolksIndividual *individual,
return g_object_new (EMPATHY_TYPE_ROSTER_CONTACT,
"individual", individual,
"group", group,
- "bottom-padding", 4,
- "top-padding", 4,
- "left-padding", 4,
- "right-padding", 12,
NULL);
}
diff --git a/libempathy-gtk/empathy-roster-contact.h b/libempathy-gtk/empathy-roster-contact.h
index 7b87e76..6e05959 100644
--- a/libempathy-gtk/empathy-roster-contact.h
+++ b/libempathy-gtk/empathy-roster-contact.h
@@ -13,13 +13,13 @@ typedef struct _EmpathyRosterContactPriv EmpathyRosterContactPriv;
struct _EmpathyRosterContactClass
{
/*<private>*/
- GtkAlignmentClass parent_class;
+ GtkListBoxRowClass parent_class;
};
struct _EmpathyRosterContact
{
/*<private>*/
- GtkAlignment parent;
+ GtkListBoxRow parent;
EmpathyRosterContactPriv *priv;
};
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]