summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <cgarcia@igalia.com>2016-03-01 08:17:21 +0100
committerMichael Catanzaro <mcatanzaro@igalia.com>2016-03-01 08:43:19 -0600
commit3e66bc83d562502d4a1c43e5699f135ddfc58ac4 (patch)
treeaa7c579b9c58ed5414d65f548c68b8f7edf1169c
parent8c13d99177a1bc259a369b2fa84f8dabc5d223c1 (diff)
downloadepiphany-3e66bc83d562502d4a1c43e5699f135ddfc58ac4.tar.gz
downloads: Ensure we always fallback to package icon
If the icon for the given content type and its fallbacks are not found in the theme, GtkImage uses the missing icon. We want to always fallback to package icon instead, so ensure it be appending it to the list of icons names used. https://bugzilla.gnome.org/show_bug.cgi?id=762825
-rw-r--r--lib/widgets/ephy-download-widget.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c
index 8e16bda7b..ed11528e2 100644
--- a/lib/widgets/ephy-download-widget.c
+++ b/lib/widgets/ephy-download-widget.c
@@ -137,9 +137,18 @@ update_download_icon (EphyDownloadWidget *widget)
const char *content_type;
content_type = ephy_download_get_content_type (widget->download);
- if (content_type)
+ if (content_type) {
icon = g_content_type_get_symbolic_icon (content_type);
- else
+ /* g_content_type_get_symbolic_icon() always creates a GThemedIcon, but we check it
+ * here just in case that changes in GLib eventually.
+ */
+ if (G_IS_THEMED_ICON (icon)) {
+ /* Ensure we always fallback to package-x-generic-symbolic if all other icons are
+ * missing in the theme.
+ */
+ g_themed_icon_append_name (G_THEMED_ICON (icon), "package-x-generic-symbolic");
+ }
+ } else
icon = g_icon_new_for_string ("package-x-generic-symbolic", NULL);
gtk_image_set_from_gicon (GTK_IMAGE (widget->icon), icon, GTK_ICON_SIZE_MENU);