diff options
author | Albert Astals <albert.astals@canonical.com> | 2012-10-10 12:16:55 +0000 |
---|---|---|
committer | Tarmac <Unknown> | 2012-10-10 12:16:55 +0000 |
commit | 2204cf861da871322c0fce1c27b473fb3eb3d57c (patch) | |
tree | dd6a9d16fcbf44589d4efbc8175818ea2032b0df /src/metadata-widget.c | |
parent | 3683d55686016a92ef05a37b0516d1d802a33ef4 (diff) | |
parent | a4eacdea8a8e63446cc64c433fb68c13cfea1cfe (diff) | |
download | ayatana-indicator-sound-2204cf861da871322c0fce1c27b473fb3eb3d57c.tar.gz ayatana-indicator-sound-2204cf861da871322c0fce1c27b473fb3eb3d57c.tar.bz2 ayatana-indicator-sound-2204cf861da871322c0fce1c27b473fb3eb3d57c.zip |
Use the file path directly if it's an absolute path. Fixes: https://bugs.launchpad.net/bugs/1024705. Approved by Conor Curran, jenkins.
Diffstat (limited to 'src/metadata-widget.c')
-rw-r--r-- | src/metadata-widget.c | 14 |
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); |