Use better icons for home and desktop.

2004-03-08  Anders Carlsson  <andersca@gnome.org>

	* gtk/gtkfilesystemunix.c: (get_icon_for_directory),
	(gtk_file_system_unix_render_icon):
	Use better icons for home and desktop.
This commit is contained in:
Anders Carlsson
2004-03-08 09:40:24 +00:00
committed by Anders Carlsson
parent 11075641e7
commit 683eff48dc
6 changed files with 50 additions and 1 deletions

View File

@ -824,6 +824,25 @@ gtk_file_system_unix_filename_to_path (GtkFileSystem *file_system,
return gtk_file_path_new_dup (filename);
}
static const char *
get_icon_for_directory (const char *path)
{
static char *desktop_path = NULL;
if (!g_get_home_dir ())
return "gnome-fs-directory";
if (!desktop_path)
desktop_path = g_build_filename (g_get_home_dir (), "Desktop", NULL);
if (strcmp (g_get_home_dir (), path) == 0)
return "gnome-fs-home";
else if (strcmp (desktop_path, path) == 0)
return "gnome-fs-desktop";
else
return "gnome-fs-directory";
}
static GdkPixbuf *
gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
const GtkFilePath *path,
@ -862,7 +881,7 @@ gtk_file_system_unix_render_icon (GtkFileSystem *file_system,
name = "gnome-fs-chardev";
break;
case ICON_DIRECTORY:
name = "gnome-fs-directory";
name = get_icon_for_directory (filename);
break;
case ICON_EXECUTABLE:
name ="gnome-fs-executable";