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.zip
rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.gz
rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.bz2
rockbox-74cbb0a1b24a5d2e32d2667b236483b5e7253e98.tar.xz
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 1f76994..a790400 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
}