summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@rockbox.org>2007-06-17 21:16:34 +0000
committerBrandon Low <lostlogic@rockbox.org>2007-06-17 21:16:34 +0000
commit74cbb0a1b24a5d2e32d2667b236483b5e7253e98 (patch)
tree4a9bd83a01bbb822305e3a567362fb3b36dfc28b /apps/tree.c
parentb57806237d275b54380be5b73e3d783bd6972bf8 (diff)
downloadrockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.gz
rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.zip
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
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c13
1 files changed, 13 insertions, 0 deletions
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)
165 return(name); 165 return(name);
166} 166}
167 167
168#ifdef HAVE_LCD_COLOR
169static int tree_get_filecolor(int selected_item, void * data)
170{
171 struct tree_context * local_tc=(struct tree_context *)data;
172 struct entry* dc = local_tc->dircache;
173 struct entry* e = &dc[selected_item];
174 return filetype_get_color(e->attr);
175}
176#endif
168 177
169static int tree_get_fileicon(int selected_item, void * data) 178static int tree_get_fileicon(int selected_item, void * data)
170{ 179{
@@ -223,6 +232,10 @@ void tree_gui_init(void)
223#endif 232#endif
224 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1); 233 gui_synclist_init(&tree_lists, &tree_get_filename, &tc, false, 1);
225 gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon); 234 gui_synclist_set_icon_callback(&tree_lists, &tree_get_fileicon);
235#ifdef HAVE_LCD_COLOR
236 gui_list_set_color_callback(&tree_lists.gui_list[SCREEN_MAIN],
237 &tree_get_filecolor);
238#endif
226} 239}
227 240
228 241