From 74cbb0a1b24a5d2e32d2667b236483b5e7253e98 Mon Sep 17 00:00:00 2001 From: Brandon Low Date: Sun, 17 Jun 2007 21:16:34 +0000 Subject: Give color targets the ability to display each LCD line a different color and use this newfangled ability to provide themable colored file types. See the comments on read_color_theme_file and the sample.colors file provided for how to use this. .colors files go in themes directory for now. This separate line color function should be trivial to add to menus and wpss. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@13656 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 1f76994968..a790400754 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -165,6 +165,15 @@ static char * tree_get_filename(int selected_item, void * data, char *buffer) return(name); } +#ifdef HAVE_LCD_COLOR +static int tree_get_filecolor(int selected_item, void * data) +{ + struct tree_context * local_tc=(struct tree_context *)data; + struct entry* dc = local_tc->dircache; + struct entry* e = &dc[selected_item]; + return filetype_get_color(e->attr); +} +#endif static int tree_get_fileicon(int selected_item, void * data) { @@ -223,6 +232,10 @@ void tree_gui_init(void) #endif gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1); gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); +#ifdef HAVE_LCD_COLOR + gui_list_set_color_callback(&tree_lists.gui_list[SCREEN_MAIN], + &tree_get_filecolor); +#endif } -- cgit v1.2.3