forked from len0rd/rockbox
my little icons in front of the files/dirs to show what kind of entry it
is, similar to how the Archos firmware works git-svn-id: svn://svn.rockbox.org/rockbox/trunk@500 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
802740cd88
commit
4674e87017
1 changed files with 11 additions and 2 deletions
|
@ -32,7 +32,7 @@
|
|||
|
||||
#define TREE_MAX_FILENAMELEN 64
|
||||
#define TREE_MAX_ON_SCREEN 7
|
||||
#define TREE_MAX_LEN_DISPLAY 17 /* max length that fits on screen */
|
||||
#define TREE_MAX_LEN_DISPLAY 16 /* max length that fits on screen */
|
||||
|
||||
void browse_root(void) {
|
||||
dirbrowse("/");
|
||||
|
@ -45,11 +45,17 @@ struct entry {
|
|||
};
|
||||
|
||||
#define LINE_Y 8 /* Y position the entry-list starts at */
|
||||
#define LINE_X 6 /* X position the entry-list starts at */
|
||||
#define LINE_X 12 /* X position the entry-list starts at */
|
||||
#define LINE_HEIGTH 8 /* pixels for each text line */
|
||||
|
||||
#ifdef HAVE_LCD_BITMAP
|
||||
|
||||
static unsigned char fileimage[] = {
|
||||
0x60, 0x7f, 0x03, 0x63, 0x7f, 0x00 };
|
||||
|
||||
static unsigned char dirimage[] = {
|
||||
0x3e, 0x26, 0x26, 0x24, 0x3c, 0x00 };
|
||||
|
||||
int static
|
||||
showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end)
|
||||
{
|
||||
|
@ -83,6 +89,9 @@ showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end)
|
|||
|
||||
buffer[i].file = !(entry->attribute&ATTR_DIRECTORY);
|
||||
|
||||
lcd_bitmap(buffer[i].file?
|
||||
fileimage:dirimage, 6, LINE_Y+i*LINE_HEIGTH, 6, 8, TRUE);
|
||||
|
||||
if(len < TREE_MAX_LEN_DISPLAY)
|
||||
lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0);
|
||||
else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue