summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorMark Arigo <markarigo@gmail.com>2006-08-23 20:02:06 +0000
committerMark Arigo <markarigo@gmail.com>2006-08-23 20:02:06 +0000
commit34301bb37bb34f478bf4c3fc78385929dd2533d8 (patch)
tree3daea2dff1a0d5216229cdb16970ee19a991632d /apps/tree.c
parent620c54a2430dec4b040275e4f56ca946c248077c (diff)
downloadrockbox-34301bb37bb34f478bf4c3fc78385929dd2533d8.zip
rockbox-34301bb37bb34f478bf4c3fc78385929dd2533d8.tar.gz
rockbox-34301bb37bb34f478bf4c3fc78385929dd2533d8.tar.bz2
rockbox-34301bb37bb34f478bf4c3fc78385929dd2533d8.tar.xz
Add optional icon to list title, current path display shows a dir icon, and list titles now left-justified.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10726 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c31
1 files changed, 22 insertions, 9 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 21405c9..4558cd5 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -349,20 +349,33 @@ static int update_dir(void)
}
}
if (!id3db) {
- if (global_settings.show_path_in_browser == SHOW_PATH_FULL) {
- gui_synclist_set_title(&tree_lists, tc.currdir);
- } else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT) {
- gui_synclist_set_title(&tree_lists,
- tc.dirlevel > 0 ? strrchr(tc.currdir, '/') + 1 : "/");
- } else {
- /* Must clear the title as the list is reused */
- gui_synclist_set_title(&tree_lists, NULL);
+ if (global_settings.show_path_in_browser == SHOW_PATH_FULL)
+ {
+ gui_synclist_set_title(&tree_lists, tc.currdir,
+ filetype_get_icon(ATTR_DIRECTORY));
+ }
+ else if (global_settings.show_path_in_browser == SHOW_PATH_CURRENT)
+ {
+ char *title = strrchr(tc.currdir, '/') + 1;
+ if (*title == '\0')
+ {
+ /* Display nothing for the root dir */
+ gui_synclist_set_title(&tree_lists, NULL, NOICON);
+ }
+ else
+ gui_synclist_set_title(&tree_lists, title,
+ filetype_get_icon(ATTR_DIRECTORY));
}
+ else
+ {
+ /* Must clear the title as the list is reused */
+ gui_synclist_set_title(&tree_lists, NULL, NOICON);
+ }
}
else
{
/* This currently doesn't work too well in id3db so turn it off */
- gui_synclist_set_title(&tree_lists, NULL);
+ gui_synclist_set_title(&tree_lists, NULL, NOICON);
}
gui_synclist_set_nb_items(&tree_lists, tc.filesindir);
gui_synclist_set_icon_callback(&tree_lists,