From 8e20415b4bf8c3af7b1533ad1eeb96bf326a5845 Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Wed, 17 Mar 2004 14:46:06 +0000 Subject: Fixed the font problem reported by Mark Bright, cleaning up some code in the process git-svn-id: svn://svn.rockbox.org/rockbox/trunk@4399 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/apps/tree.c b/apps/tree.c index 9842450e9d..2098f03e4f 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -234,6 +234,7 @@ static void showfileline(int line, int direntry, bool scroll, int *dirfilter) { char* name = dircache[direntry].name; int xpos = LINE_X; + char* dotpos = NULL; #ifdef HAVE_LCD_CHARCELLS if (!global_settings.show_icons) @@ -244,35 +245,26 @@ static void showfileline(int line, int direntry, bool scroll, int *dirfilter) if (*dirfilter != SHOW_ALL && !(dircache[direntry].attr & ATTR_DIRECTORY)) { - char* dotpos = strrchr(name, '.'); - char temp=0; + dotpos = strrchr(name, '.'); if (dotpos) { - temp = *dotpos; *dotpos = 0; } - if(scroll) -#ifdef HAVE_LCD_BITMAP - if (global_settings.invert_cursor) - lcd_puts_scroll_style(xpos, line, name, STYLE_INVERT); - else -#endif - lcd_puts_scroll(xpos, line, name); - else - lcd_puts(xpos, line, name); - if (temp) - *dotpos = temp; } - else { - if(scroll) + + if(scroll) { #ifdef HAVE_LCD_BITMAP - if (global_settings.invert_cursor) - lcd_puts_scroll_style(xpos, line, name, STYLE_INVERT); - else -#endif - lcd_puts_scroll(xpos, line, name); + lcd_setfont(FONT_UI); + if (global_settings.invert_cursor) + lcd_puts_scroll_style(xpos, line, name, STYLE_INVERT); else - lcd_puts(xpos, line, name); - } +#endif + lcd_puts_scroll(xpos, line, name); + } else + lcd_puts(xpos, line, name); + + /* Restore the dot before the extension if it was removed */ + if (dotpos) + *dotpos = '.'; } /* load sorted directory into dircache. returns NULL on failure. */ -- cgit v1.2.3