diff options
author | Xavier Claessens <xclaesse@gmail.com> | 2010-01-06 23:37:47 +0800 |
---|---|---|
committer | Xavier Claessens <xclaesse@gmail.com> | 2010-01-06 23:45:09 +0800 |
commit | 6137828a9955f5e571a08f503ba46308568fb4e0 (patch) | |
tree | 01b707098f1efa7f2d69e0d975904a06eb8cd983 | |
parent | a8260d4f1de4ab185922be3b7713c15f55f1f0a3 (diff) | |
download | gsoc2013-empathy-6137828a9955f5e571a08f503ba46308568fb4e0.tar.gz gsoc2013-empathy-6137828a9955f5e571a08f503ba46308568fb4e0.tar.zst gsoc2013-empathy-6137828a9955f5e571a08f503ba46308568fb4e0.zip |
Add the protocol icon in EmpathyContactWidget. That's displayed for contact list tooltip too.
-rw-r--r-- | libempathy-gtk/empathy-contact-widget.c | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-contact-widget.c b/libempathy-gtk/empathy-contact-widget.c index 7a3c04ec8..0475b48ed 100644 --- a/libempathy-gtk/empathy-contact-widget.c +++ b/libempathy-gtk/empathy-contact-widget.c @@ -88,6 +88,8 @@ typedef struct GtkWidget *vbox_contact; GtkWidget *widget_avatar; GtkWidget *widget_account; + GtkWidget *image_account; + GtkWidget *label_account; GtkWidget *widget_id; GtkWidget *widget_alias; GtkWidget *label_alias; @@ -619,11 +621,23 @@ contact_widget_contact_setup (EmpathyContactWidget *information) } else { - information->widget_account = gtk_label_new (NULL); + /* Pack the protocol icon with the account name in an hbox */ + information->widget_account = gtk_hbox_new (FALSE, 6); + + information->label_account = gtk_label_new (NULL); if (!(information->flags & EMPATHY_CONTACT_WIDGET_FOR_TOOLTIP)) { - gtk_label_set_selectable (GTK_LABEL (information->widget_account), TRUE); + gtk_label_set_selectable (GTK_LABEL (information->label_account), TRUE); } - gtk_misc_set_alignment (GTK_MISC (information->widget_account), 0, 0.5); + gtk_misc_set_alignment (GTK_MISC (information->label_account), 0, 0.5); + gtk_widget_show (information->label_account); + + information->image_account = gtk_image_new (); + gtk_widget_show (information->image_account); + + gtk_box_pack_start (GTK_BOX (information->widget_account), + information->image_account, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (information->widget_account), + information->label_account, FALSE, TRUE, 0); } gtk_table_attach_defaults (GTK_TABLE (information->table_contact), information->widget_account, @@ -759,7 +773,11 @@ contact_widget_contact_update (EmpathyContactWidget *information) const gchar *name; name = tp_account_get_display_name (account); - gtk_label_set_label (GTK_LABEL (information->widget_account), name); + gtk_label_set_label (GTK_LABEL (information->label_account), name); + + name = tp_account_get_icon_name (account); + gtk_image_set_from_icon_name (GTK_IMAGE (information->image_account), + name, GTK_ICON_SIZE_MENU); } } |