From 3dbfc1935f70b9f2ca38505a35e643ebe64cc46f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 11 Jun 2008 03:17:55 +0000 Subject: [PATCH] Add standard icon names, and also fall back to builtin gtk stock icons. * gtk/gtkfilesystem.c (get_icon_for_special_directory): (gtk_file_system_volume_render_icon): Add standard icon names, and also fall back to builtin gtk stock icons. svn path=/trunk/; revision=20350 --- ChangeLog | 6 ++++++ gtk/gtkfilesystem.c | 28 ++++++++++++++++++++++++---- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f49851e12a..9e7cf10e10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-10 Christian Persch + + * gtk/gtkfilesystem.c (get_icon_for_special_directory): + (gtk_file_system_volume_render_icon): Add standard icon names, + and also fall back to builtin gtk stock icons. + 2008-06-10 Christian Persch * gtk/gtktreeview.c: (destroy_info), (set_destination_row), diff --git a/gtk/gtkfilesystem.c b/gtk/gtkfilesystem.c index aa89a2c115..027f1bb49c 100644 --- a/gtk/gtkfilesystem.c +++ b/gtk/gtkfilesystem.c @@ -1649,7 +1649,7 @@ get_pixbuf_from_gicon (GIcon *icon, icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, icon, icon_size, - 0); + GTK_ICON_LOOKUP_USE_BUILTIN); if (!icon_info) return NULL; @@ -1671,8 +1671,15 @@ get_icon_for_special_directory (GFile *file) if (g_file_equal (file, special_file)) { + const char *names[] = { + "user-desktop", + "gnome-fs-desktop", + "folder", + "gtk-directory", + NULL + }; g_object_unref (special_file); - return g_themed_icon_new ("gnome-fs-desktop"); + return g_themed_icon_new_from_names (names, -1); } g_object_unref (special_file); @@ -1681,8 +1688,15 @@ get_icon_for_special_directory (GFile *file) if (g_file_equal (file, special_file)) { + const char *names[] = { + "user-home", + "gnome-fs-home", + "folder", + "gtk-directory", + NULL + }; g_object_unref (special_file); - return g_themed_icon_new ("gnome-fs-home"); + return g_themed_icon_new_from_names (names, -1); } g_object_unref (special_file); @@ -1698,11 +1712,17 @@ gtk_file_system_volume_render_icon (GtkFileSystemVolume *volume, { GIcon *icon = NULL; GdkPixbuf *pixbuf; + const char *harddisk_icons[] = { + "drive-harddisk", + "gnome-dev-harddisk", + "gtk-harddisk", + NULL + }; DEBUG ("volume_get_icon_name"); if (IS_ROOT_VOLUME (volume)) - icon = g_themed_icon_new ("gnome-dev-harddisk"); + icon = g_themed_icon_new_from_names (harddisk_icons, -1); else if (G_IS_DRIVE (volume)) icon = g_drive_get_icon (G_DRIVE (volume)); else if (G_IS_VOLUME (volume))