From 42770ea88ea44363f4a2765b6d491ed2a04e4bd5 Mon Sep 17 00:00:00 2001 From: Björn Stenberg Date: Mon, 10 Jun 2002 13:24:27 +0000 Subject: Added filename scrolling git-svn-id: svn://svn.rockbox.org/rockbox/trunk@937 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) (limited to 'apps/tree.c') diff --git a/apps/tree.c b/apps/tree.c index 7bb473f28e..01580e7104 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -154,14 +154,7 @@ static int showdir(char *path, int start) 6, MARGIN_Y+(i-start)*LINE_HEIGTH, 6, 8, true); #endif - if(len < TREE_MAX_LEN_DISPLAY) - lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name); - else { - char storage = dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY]; - dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY]=0; - lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name); - dircacheptr[i]->name[TREE_MAX_LEN_DISPLAY]=storage; - } + lcd_puts(LINE_X, LINE_Y+i-start, dircacheptr[i]->name); } return filesindir; @@ -235,6 +228,8 @@ bool dirbrowse(char *root) return -1; /* root is not a directory */ lcd_puts(0, dircursor, CURSOR_CHAR); + lcd_puts_scroll(LINE_X, LINE_Y+dircursor, + dircacheptr[start+dircursor]->name); #ifdef HAVE_LCD_BITMAP lcd_update(); #endif @@ -298,8 +293,8 @@ bool dirbrowse(char *root) dircursor=0; start=0; } else { - int len= - strlen(dircacheptr[dircursor+start]->name); + int len=strlen(dircacheptr[dircursor+start]->name); + lcd_stop_scroll(); if((len > 4) && !strcmp(&dircacheptr[dircursor+start]->name[len-4], ".m3u")) { @@ -369,6 +364,7 @@ bool dirbrowse(char *root) #else case BUTTON_MENU: #endif + lcd_stop_scroll(); main_menu(); /* restore display */ @@ -384,6 +380,11 @@ bool dirbrowse(char *root) break; } + + lcd_stop_scroll(); + lcd_puts_scroll(LINE_X, LINE_Y+dircursor, + dircacheptr[start+dircursor]->name); + lcd_update(); } -- cgit v1.2.3