From 4674e870173ec46bfd2eb6b552aadc04669fd830 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 7 May 2002 22:56:01 +0000 Subject: 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 --- uisimulator/tree.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'uisimulator') diff --git a/uisimulator/tree.c b/uisimulator/tree.c index c8d15ac5b9..5dfafe1824 100644 --- a/uisimulator/tree.c +++ b/uisimulator/tree.c @@ -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 { -- cgit v1.2.3