diff options
author | Conor Curran <conor.curran@canonical.com> | 2011-07-12 20:17:57 +0100 |
---|---|---|
committer | Conor Curran <conor.curran@canonical.com> | 2011-07-12 20:17:57 +0100 |
commit | 8cabcd77fd3788d9b2b3ffeb09b57a46bcfa640e (patch) | |
tree | 83b11cdf347dbdfa805ea476cb96243e4301ac79 /src | |
parent | 6fe9d17b60870f96ff4325277118e555e8054d74 (diff) | |
download | ayatana-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')
-rw-r--r-- | src/indicator-session.c | 28 | ||||
-rw-r--r-- | src/user-widget.c | 1 |
2 files changed, 27 insertions, 2 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)); diff --git a/src/user-widget.c b/src/user-widget.c index 22f611c..9b046c5 100644 --- a/src/user-widget.c +++ b/src/user-widget.c @@ -203,7 +203,6 @@ user_widget_primitive_draw_cb_gtk_3 (GtkWidget *widget, return FALSE; } - GtkStyle *style; gdouble x, y; gdouble offset = 15.0; |