diff options
-rw-r--r-- | src/file-manager/fm-properties-window.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/src/file-manager/fm-properties-window.c b/src/file-manager/fm-properties-window.c index 3be02ed9..88a97e55 100644 --- a/src/file-manager/fm-properties-window.c +++ b/src/file-manager/fm-properties-window.c @@ -364,11 +364,13 @@ add_prompt_and_separator (GtkWidget *vbox, const char *prompt_text) static void get_image_for_properties_window (FMPropertiesWindow *window, char **icon_name, + char **display_name_, GdkPixbuf **icon_pixbuf) { CajaIconInfo *icon, *new_icon; GList *l; gint icon_scale; + gchar *display_name = NULL; icon = NULL; icon_scale = gtk_widget_get_scale_factor (GTK_WIDGET (window->details->notebook)); @@ -382,6 +384,7 @@ get_image_for_properties_window (FMPropertiesWindow *window, icon = caja_file_get_icon (file, CAJA_ICON_SIZE_STANDARD, icon_scale, CAJA_FILE_ICON_FLAGS_USE_THUMBNAILS | CAJA_FILE_ICON_FLAGS_IGNORE_VISITING); + display_name = caja_file_get_string_attribute (file, "type"); } else { new_icon = caja_file_get_icon (file, CAJA_ICON_SIZE_STANDARD, icon_scale, CAJA_FILE_ICON_FLAGS_USE_THUMBNAILS | @@ -390,6 +393,8 @@ get_image_for_properties_window (FMPropertiesWindow *window, g_object_unref (icon); g_object_unref (new_icon); icon = NULL; + g_free (display_name); + display_name = g_strdup (_("Multiple files")); break; } g_object_unref (new_icon); @@ -406,11 +411,23 @@ get_image_for_properties_window (FMPropertiesWindow *window, *icon_name = g_strdup (caja_icon_info_get_used_name (icon)); } + if (display_name_ != NULL) { + if (! display_name) { + display_name = g_strdup (_("No files")); + } else if (! caja_icon_info_get_used_name (icon)) { + g_free (display_name); + display_name = g_strdup (_("User-defined icon")); + } + *display_name_ = display_name; + display_name = NULL; + } + if (icon_pixbuf != NULL) { *icon_pixbuf = caja_icon_info_get_pixbuf_at_size (icon, CAJA_ICON_SIZE_STANDARD); } g_object_unref (icon); + g_free (display_name); } static void @@ -419,8 +436,9 @@ update_properties_window_icon (FMPropertiesWindow *window) GdkPixbuf *pixbuf; cairo_surface_t *surface; char *name; + char *display_name; - get_image_for_properties_window (window, &name, &pixbuf); + get_image_for_properties_window (window, &name, &display_name, &pixbuf); if (name != NULL) { gtk_window_set_icon_name (GTK_WINDOW (window), name); @@ -432,7 +450,10 @@ update_properties_window_icon (FMPropertiesWindow *window) gtk_widget_get_window (GTK_WIDGET (window))); gtk_image_set_from_surface (GTK_IMAGE (window->details->icon_image), surface); + atk_object_set_name (gtk_widget_get_accessible (window->details->icon_image), display_name); + g_free (name); + g_free (display_name); g_object_unref (pixbuf); cairo_surface_destroy (surface); } @@ -547,7 +568,8 @@ create_image_widget (FMPropertiesWindow *window, button = NULL; if (is_customizable) { button = gtk_button_new (); - gtk_container_add (GTK_CONTAINER (button), image); + gtk_widget_set_tooltip_text (button, _("Change associated icon")); + gtk_button_set_image (GTK_BUTTON (button), image); /* prepare the image to receive dropped objects to assign custom images */ gtk_drag_dest_set (GTK_WIDGET (image), |