aboutsummaryrefslogtreecommitdiff
path: root/src/indicator-session.c
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-07-12 20:17:57 +0100
committerConor Curran <conor.curran@canonical.com>2011-07-12 20:17:57 +0100
commit8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e (patch)
tree83b11cdf347dbdfa805ea476cb96243e4301ac79 /src/indicator-session.c
parent6fe9d17b60870f96ff4325277118e555e8054d74 (diff)
downloadayatana-indicator-session-8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e.tar.gz
ayatana-indicator-session-8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e.tar.bz2
ayatana-indicator-session-8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e.zip
correct icon on the user panel
Diffstat (limited to 'src/indicator-session.c')
-rw-r--r--src/indicator-session.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/indicator-session.c b/src/indicator-session.c
index f254957..58708fd 100644
--- a/src/indicator-session.c
+++ b/src/indicator-session.c
@@ -131,7 +131,33 @@ indicator_session_init (IndicatorSession *self)
// users
self->users.menu = GTK_MENU (dbusmenu_gtkmenu_new (INDICATOR_USERS_DBUS_NAME,
INDICATOR_USERS_DBUS_OBJECT));
- self->users.image = indicator_image_helper (USER_ITEM_ICON_DEFAULT);
+ // Set the image to the default avator image
+ GdkPixbuf* pixbuf = NULL;
+ GError* error = NULL;
+ pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (),
+ "avatar-default",
+ 17,
+ GTK_ICON_LOOKUP_FORCE_SIZE,
+ &error);
+
+
+
+ GtkWidget* avatar_icon = NULL;
+
+ if (pixbuf == NULL || error != NULL) {
+ g_warning ("Could not load the default avatar image for some reason");
+ self->users.image = indicator_image_helper (USER_ITEM_ICON_DEFAULT);
+ }
+ else{
+ avatar_icon = gtk_image_new ();
+ gtk_image_set_from_pixbuf (GTK_IMAGE (avatar_icon), pixbuf);
+ self->users.image = GTK_IMAGE (avatar_icon);
+ g_object_unref (pixbuf);
+ }
+
+
+
+ //self->users.image = indicator_image_helper (USER_ITEM_ICON_DEFAULT);
self->users.label = GTK_LABEL (gtk_label_new (NULL));
// Only show once we have a valid username
gtk_widget_hide (GTK_WIDGET(self->users.label));