aboutsummaryrefslogtreecommitdiff
path: root/src/metadata-widget.c
diff options
context:
space:
mode:
authorAlbert Astals <albert.astals@canonical.com>2012-10-10 09:50:16 +0200
committerAlbert Astals <albert.astals@canonical.com>2012-10-10 09:50:16 +0200
commita4eacdea8a8e63446cc64c433fb68c13cfea1cfe (patch)
treedd6a9d16fcbf44589d4efbc8175818ea2032b0df /src/metadata-widget.c
parent3683d55686016a92ef05a37b0516d1d802a33ef4 (diff)
downloadayatana-indicator-sound-a4eacdea8a8e63446cc64c433fb68c13cfea1cfe.tar.gz
ayatana-indicator-sound-a4eacdea8a8e63446cc64c433fb68c13cfea1cfe.tar.bz2
ayatana-indicator-sound-a4eacdea8a8e63446cc64c433fb68c13cfea1cfe.zip
Use the file path directly if it's an absolute path
Diffstat (limited to 'src/metadata-widget.c')
-rw-r--r--src/metadata-widget.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/metadata-widget.c b/src/metadata-widget.c
index 4d7763f..812f340 100644
--- a/src/metadata-widget.c
+++ b/src/metadata-widget.c
@@ -804,8 +804,18 @@ metadata_widget_set_icon (MetadataWidget *self)
dbusmenu_menuitem_property_get ( priv->twin_item,
DBUSMENU_METADATA_MENUITEM_PLAYER_ICON ));
}
-
- gtk_image_set_from_icon_name(GTK_IMAGE (priv->player_icon), app_panel->str, GTK_ICON_SIZE_MENU);
+
+ const GtkIconSize icon_size = GTK_ICON_SIZE_MENU;
+ if (g_path_is_absolute(app_panel->str) && g_file_test (app_panel->str, G_FILE_TEST_IS_REGULAR)){
+ gint width, height;
+ gtk_icon_size_lookup (icon_size, &width, &height);
+ GdkPixbuf *pix = gdk_pixbuf_new_from_file_at_scale(app_panel->str, width, height, TRUE, NULL);
+ gtk_image_set_from_pixbuf (GTK_IMAGE (priv->player_icon), pix);
+ g_object_unref (pix);
+ }
+ else{
+ gtk_image_set_from_icon_name(GTK_IMAGE (priv->player_icon), app_panel->str, icon_size);
+ }
g_string_free ( app_panel, TRUE);
g_string_free ( banshee_string, TRUE);