summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/apps/tree.c b/apps/tree.c
index 7a4a49278b..88bdaddff8 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -67,7 +67,11 @@ void browse_root(void)
67#define LINE_Y 0 /* Y position the entry-list starts at */ 67#define LINE_Y 0 /* Y position the entry-list starts at */
68#define LINE_X 2 /* X position the entry-list starts at */ 68#define LINE_X 2 /* X position the entry-list starts at */
69#define LINE_HEIGTH 8 /* pixels for each text line */ 69#define LINE_HEIGTH 8 /* pixels for each text line */
70#define CURSOR_CHAR "-" 70
71#define CURSOR_Y 1 /* the cursor is not positioned in regard to
72 the margins, so this is the amount of lines
73 we add to the cursor Y position to position
74 it on a line */
71 75
72extern unsigned char bitmap_icons_6x8[LastIcon][6]; 76extern unsigned char bitmap_icons_6x8[LastIcon][6];
73 77
@@ -78,11 +82,7 @@ extern unsigned char bitmap_icons_6x8[LastIcon][6];
78#define LINE_Y 0 /* Y position the entry-list starts at */ 82#define LINE_Y 0 /* Y position the entry-list starts at */
79#define LINE_X 1 /* X position the entry-list starts at */ 83#define LINE_X 1 /* X position the entry-list starts at */
80 84
81#ifdef HAVE_NEW_CHARCELL_LCD 85#define CURSOR_Y 0 /* not really used for players */
82#define CURSOR_CHAR "\x7e"
83#else
84#define CURSOR_CHAR "\x89"
85#endif
86 86
87#endif /* HAVE_LCD_BITMAP */ 87#endif /* HAVE_LCD_BITMAP */
88 88
@@ -239,7 +239,7 @@ bool dirbrowse(char *root)
239 if (numentries == -1) 239 if (numentries == -1)
240 return -1; /* root is not a directory */ 240 return -1; /* root is not a directory */
241 241
242 lcd_puts(0, dircursor, CURSOR_CHAR); 242 put_cursorxy(0, CURSOR_Y + dircursor, true);
243 if ( numentries ) 243 if ( numentries )
244 lcd_puts_scroll(LINE_X, LINE_Y+dircursor, 244 lcd_puts_scroll(LINE_X, LINE_Y+dircursor,
245 dircacheptr[start+dircursor]->name); 245 dircacheptr[start+dircursor]->name);
@@ -266,7 +266,7 @@ bool dirbrowse(char *root)
266 else 266 else
267 start = dircursor = 0; 267 start = dircursor = 0;
268 numentries = showdir(currdir, start); 268 numentries = showdir(currdir, start);
269 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 269 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
270 } 270 }
271 else 271 else
272 mpeg_stop(); 272 mpeg_stop();
@@ -310,21 +310,21 @@ bool dirbrowse(char *root)
310 } 310 }
311 } 311 }
312 numentries = showdir(currdir, start); 312 numentries = showdir(currdir, start);
313 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 313 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
314 break; 314 break;
315 315
316 case TREE_PREV: 316 case TREE_PREV:
317 if(dircursor) { 317 if(dircursor) {
318 lcd_puts(0, LINE_Y+dircursor, " "); 318 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false);
319 dircursor--; 319 dircursor--;
320 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 320 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
321 lcd_update(); 321 lcd_update();
322 } 322 }
323 else { 323 else {
324 if (start) { 324 if (start) {
325 start--; 325 start--;
326 numentries = showdir(currdir, start); 326 numentries = showdir(currdir, start);
327 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 327 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
328 } 328 }
329 } 329 }
330 break; 330 break;
@@ -332,14 +332,14 @@ bool dirbrowse(char *root)
332 case TREE_NEXT: 332 case TREE_NEXT:
333 if (dircursor + start + 1 < numentries ) { 333 if (dircursor + start + 1 < numentries ) {
334 if(dircursor+1 < TREE_MAX_ON_SCREEN) { 334 if(dircursor+1 < TREE_MAX_ON_SCREEN) {
335 lcd_puts(0, LINE_Y+dircursor, " "); 335 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, false);
336 dircursor++; 336 dircursor++;
337 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 337 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
338 } 338 }
339 else { 339 else {
340 start++; 340 start++;
341 numentries = showdir(currdir, start); 341 numentries = showdir(currdir, start);
342 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 342 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
343 } 343 }
344 } 344 }
345 break; 345 break;
@@ -352,7 +352,7 @@ bool dirbrowse(char *root)
352 /* TODO: this is just a copy from BUTTON_STOP, fix it */ 352 /* TODO: this is just a copy from BUTTON_STOP, fix it */
353 lcd_clear_display(); 353 lcd_clear_display();
354 numentries = showdir(currdir, start); 354 numentries = showdir(currdir, start);
355 lcd_puts(0, LINE_Y+dircursor, CURSOR_CHAR); 355 put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true);
356 356
357 break; 357 break;
358 } 358 }