From 1c44c9a038f8e3b063c09660ea3e698fff652a12 Mon Sep 17 00:00:00 2001 From: rbuj Date: Fri, 31 Jan 2020 14:34:52 +0100 Subject: dlg-batch-add: set dialog image from icon-name instead of pixbuf --- src/dlg-batch-add.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/src/dlg-batch-add.c b/src/dlg-batch-add.c index d3dac4a..a373396 100644 --- a/src/dlg-batch-add.c +++ b/src/dlg-batch-add.c @@ -37,7 +37,6 @@ #include "typedefs.h" -#define ARCHIVE_ICON_SIZE (48) #define BAD_CHARS "/\\*" #define GET_WIDGET(x) (_gtk_builder_get_widget (data->builder, (x))) @@ -401,16 +400,14 @@ archive_type_combo_box_changed_cb (GtkComboBox *combo_box, { const char *mime_type; int idx = gtk_combo_box_get_active (combo_box); - GdkPixbuf *icon; + char *icon_name; mime_type = mime_type_desc[data->supported_types[idx]].mime_type; - - icon = get_mime_type_pixbuf (mime_type, ARCHIVE_ICON_SIZE, NULL); - if (icon != NULL) { - gtk_image_set_from_pixbuf (GTK_IMAGE (GET_WIDGET ("archive_icon_image")), icon); - g_object_unref (icon); + if ((icon_name = g_content_type_get_generic_icon_name (mime_type)) != NULL) { + gtk_image_set_from_icon_name (GTK_IMAGE (GET_WIDGET ("archive_icon_image")), + icon_name, GTK_ICON_SIZE_DIALOG); + g_free (icon_name); } - update_sensitivity_for_mime_type (data, mime_type); } -- cgit v1.2.1