From e10fc4c86cddb60c275c2b65dddc787e08fea92f Mon Sep 17 00:00:00 2001 From: Linus Nielsen Feltzing Date: Thu, 8 Aug 2002 10:46:10 +0000 Subject: Now adjusts if the cursor goes off-screen on status bar changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@1609 a1c6a512-1295-4272-9138-f99709370657 --- apps/tree.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'apps') diff --git a/apps/tree.c b/apps/tree.c index e09492946b..5d9277e570 100644 --- a/apps/tree.c +++ b/apps/tree.c @@ -482,10 +482,6 @@ bool dirbrowse(char *root) #ifdef HAVE_LCD_BITMAP if(global_settings.statusbar) { statusbar_toggle(); - if(CURSOR_Y+LINE_Y+dircursor>TREE_MAX_ON_SCREEN) { - start++; - dircursor--; - } restore = true; } #endif @@ -520,6 +516,12 @@ bool dirbrowse(char *root) if ( restore ) { /* restore display */ + /* We need to adjust if the number of lines on screen have + changed because of a status bar change */ + if(CURSOR_Y+LINE_Y+dircursor>TREE_MAX_ON_SCREEN) { + start++; + dircursor--; + } numentries = showdir(currdir, start); put_cursorxy(0, CURSOR_Y + LINE_Y+dircursor, true); } -- cgit v1.2.3