summaryrefslogtreecommitdiff
path: root/apps/tree.c
diff options
context:
space:
mode:
authorMarcoen Hirschberg <marcoen@gmail.com>2005-06-11 17:35:30 +0000
committerMarcoen Hirschberg <marcoen@gmail.com>2005-06-11 17:35:30 +0000
commit7527bfb4d6c49ad6ab6b89e636122e56ec16be34 (patch)
treee6402fbf15fd298ca235c46ee818ce3ad5ee54f8 /apps/tree.c
parentb30962f9f3c29795f2ddf56c72e0f4e0ca378b6f (diff)
downloadrockbox-7527bfb4d6c49ad6ab6b89e636122e56ec16be34.tar.gz
rockbox-7527bfb4d6c49ad6ab6b89e636122e56ec16be34.zip
center-scrolling: start scrolling when the cursor is at 2/3 of the screen. There is still a bug when the fontsize changes.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6678 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tree.c')
-rw-r--r--apps/tree.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/tree.c b/apps/tree.c
index ca86bb2725..e9a648ed80 100644
--- a/apps/tree.c
+++ b/apps/tree.c
@@ -844,7 +844,10 @@ static bool dirbrowse(void)
844 if (!tc.filesindir) 844 if (!tc.filesindir)
845 break; 845 break;
846 846
847 if (tc.dircursor) { 847 /* start scrolling when at 1/3 of the screen */
848 if (tc.dircursor >=
849 tree_max_on_screen - (2 * tree_max_on_screen) / 3
850 || (tc.dirstart == 0 && tc.dircursor > 0)) {
848 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, false); 851 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, false);
849 tc.dircursor--; 852 tc.dircursor--;
850 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true); 853 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true);
@@ -906,7 +909,9 @@ static bool dirbrowse(void)
906 break; 909 break;
907 910
908 if (tc.dircursor + tc.dirstart + 1 < numentries ) { 911 if (tc.dircursor + tc.dirstart + 1 < numentries ) {
909 if(tc.dircursor+1 < tree_max_on_screen) { 912 /* start scrolling when at 2/3 of the screen */
913 if(tc.dircursor < (2 * tree_max_on_screen) / 3 ||
914 numentries - tc.dirstart <= tree_max_on_screen) {
910 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, false); 915 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, false);
911 tc.dircursor++; 916 tc.dircursor++;
912 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true); 917 put_cursorxy(CURSOR_X, CURSOR_Y + tc.dircursor, true);