diff options
Diffstat (limited to 'apps')
-rw-r--r-- | apps/tree.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/apps/tree.c b/apps/tree.c index 639e522978..d43d46bc7d 100644 --- a/apps/tree.c +++ b/apps/tree.c | |||
@@ -42,9 +42,9 @@ | |||
42 | #include "status.h" | 42 | #include "status.h" |
43 | #include "debug.h" | 43 | #include "debug.h" |
44 | #include "ata.h" | 44 | #include "ata.h" |
45 | #include "icons.h" | ||
45 | 46 | ||
46 | #ifdef HAVE_LCD_BITMAP | 47 | #ifdef HAVE_LCD_BITMAP |
47 | #include "icons.h" | ||
48 | #include "widgets.h" | 48 | #include "widgets.h" |
49 | #endif | 49 | #endif |
50 | 50 | ||
@@ -102,7 +102,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6]; | |||
102 | 102 | ||
103 | #define TREE_MAX_ON_SCREEN 2 | 103 | #define TREE_MAX_ON_SCREEN 2 |
104 | #define TREE_MAX_LEN_DISPLAY 11 /* max length that fits on screen */ | 104 | #define TREE_MAX_LEN_DISPLAY 11 /* max length that fits on screen */ |
105 | #define LINE_X 1 /* X position the entry-list starts at */ | 105 | #define LINE_X 2 /* X position the entry-list starts at */ |
106 | #define LINE_Y 0 /* Y position the entry-list starts at */ | 106 | #define LINE_Y 0 /* Y position the entry-list starts at */ |
107 | 107 | ||
108 | #define CURSOR_X 0 | 108 | #define CURSOR_X 0 |
@@ -170,9 +170,11 @@ static int compare(const void* p1, const void* p2) | |||
170 | 170 | ||
171 | static int showdir(char *path, int start) | 171 | static int showdir(char *path, int start) |
172 | { | 172 | { |
173 | #ifdef HAVE_LCD_BITMAP | ||
174 | int icon_type = 0; | 173 | int icon_type = 0; |
174 | #ifdef HAVE_LCD_BITMAP | ||
175 | int line_height = LINE_HEIGTH; | 175 | int line_height = LINE_HEIGTH; |
176 | #else | ||
177 | char tmpstring[2]; | ||
176 | #endif | 178 | #endif |
177 | int i; | 179 | int i; |
178 | int tree_max_on_screen; | 180 | int tree_max_on_screen; |
@@ -291,7 +293,6 @@ static int showdir(char *path, int start) | |||
291 | 293 | ||
292 | len = strlen(dircache[i].name); | 294 | len = strlen(dircache[i].name); |
293 | 295 | ||
294 | #ifdef HAVE_LCD_BITMAP | ||
295 | if ( dircache[i].attr & ATTR_DIRECTORY ) | 296 | if ( dircache[i].attr & ATTR_DIRECTORY ) |
296 | icon_type = Folder; | 297 | icon_type = Folder; |
297 | else if ( dircache[i].attr & TREE_ATTR_M3U ) | 298 | else if ( dircache[i].attr & TREE_ATTR_M3U ) |
@@ -303,10 +304,16 @@ static int showdir(char *path, int start) | |||
303 | else | 304 | else |
304 | icon_type = 0; | 305 | icon_type = 0; |
305 | 306 | ||
307 | #ifdef HAVE_LCD_BITMAP | ||
306 | if (icon_type) | 308 | if (icon_type) |
307 | lcd_bitmap(bitmap_icons_6x8[icon_type], | 309 | lcd_bitmap(bitmap_icons_6x8[icon_type], |
308 | CURSOR_X * 6 + CURSOR_WIDTH, | 310 | CURSOR_X * 6 + CURSOR_WIDTH, |
309 | MARGIN_Y+(i-start)*line_height, 6, 8, true); | 311 | MARGIN_Y+(i-start)*line_height, 6, 8, true); |
312 | #else | ||
313 | lcd_define_pattern(0,tree_icons_5x7[0],LastTreeIcon*8); | ||
314 | tmpstring[0] = icon_type; | ||
315 | tmpstring[1] = 0; | ||
316 | lcd_puts(LINE_X-1, i-start, tmpstring); | ||
310 | #endif | 317 | #endif |
311 | 318 | ||
312 | /* if MP3 filter is on, cut off the extension */ | 319 | /* if MP3 filter is on, cut off the extension */ |