summaryrefslogtreecommitdiff
path: root/uisimulator/tree.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-07 22:56:01 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-07 22:56:01 +0000
commit4674e870173ec46bfd2eb6b552aadc04669fd830 (patch)
tree4ed3e010b3bc2a59481319656d894a695a339f53 /uisimulator/tree.c
parent802740cd88f82ed83dc11f299ada3264d015add0 (diff)
downloadrockbox-4674e870173ec46bfd2eb6b552aadc04669fd830.tar.gz
rockbox-4674e870173ec46bfd2eb6b552aadc04669fd830.zip
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
Diffstat (limited to 'uisimulator/tree.c')
-rw-r--r--uisimulator/tree.c13
1 files changed, 11 insertions, 2 deletions
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 @@
32 32
33#define TREE_MAX_FILENAMELEN 64 33#define TREE_MAX_FILENAMELEN 64
34#define TREE_MAX_ON_SCREEN 7 34#define TREE_MAX_ON_SCREEN 7
35#define TREE_MAX_LEN_DISPLAY 17 /* max length that fits on screen */ 35#define TREE_MAX_LEN_DISPLAY 16 /* max length that fits on screen */
36 36
37void browse_root(void) { 37void browse_root(void) {
38 dirbrowse("/"); 38 dirbrowse("/");
@@ -45,11 +45,17 @@ struct entry {
45}; 45};
46 46
47#define LINE_Y 8 /* Y position the entry-list starts at */ 47#define LINE_Y 8 /* Y position the entry-list starts at */
48#define LINE_X 6 /* X position the entry-list starts at */ 48#define LINE_X 12 /* X position the entry-list starts at */
49#define LINE_HEIGTH 8 /* pixels for each text line */ 49#define LINE_HEIGTH 8 /* pixels for each text line */
50 50
51#ifdef HAVE_LCD_BITMAP 51#ifdef HAVE_LCD_BITMAP
52 52
53static unsigned char fileimage[] = {
54 0x60, 0x7f, 0x03, 0x63, 0x7f, 0x00 };
55
56static unsigned char dirimage[] = {
57 0x3e, 0x26, 0x26, 0x24, 0x3c, 0x00 };
58
53int static 59int static
54showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end) 60showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end)
55{ 61{
@@ -83,6 +89,9 @@ showdir(char *path, struct entry *buffer, int start, int scrollpos, int* at_end)
83 89
84 buffer[i].file = !(entry->attribute&ATTR_DIRECTORY); 90 buffer[i].file = !(entry->attribute&ATTR_DIRECTORY);
85 91
92 lcd_bitmap(buffer[i].file?
93 fileimage:dirimage, 6, LINE_Y+i*LINE_HEIGTH, 6, 8, TRUE);
94
86 if(len < TREE_MAX_LEN_DISPLAY) 95 if(len < TREE_MAX_LEN_DISPLAY)
87 lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0); 96 lcd_puts(LINE_X, LINE_Y+i*LINE_HEIGTH, buffer[i].name, 0);
88 else { 97 else {