1
0
Fork 0
forked from len0rd/rockbox

FM preset menu: Set cursor to the current preset on enter. Added a generic function to the menu system which allows for setting the position.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@6264 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Jens Arnold 2005-04-10 17:36:55 +00:00
parent 06068b451d
commit cef15c6efc
3 changed files with 14 additions and 1 deletions

View file

@ -166,7 +166,7 @@ void menu_draw(int m)
#endif
/* Adjust cursor pos if it's below the screen */
if (menus[m].cursor - menus[m].top >= menu_lines)
menus[m].top++;
menus[m].top = menus[m].cursor - (menu_lines - 1);
/* Adjust cursor pos if it's above the screen */
if(menus[m].cursor < menus[m].top)
@ -508,3 +508,13 @@ bool menu_movedown(int menu)
return true;
}
/*
* Allows to set the cursor position. Doesn't redraw by itself.
*/
void menu_set_cursor(int menu, int position)
{
menus[menu].cursor = position;
}