summaryrefslogtreecommitdiff
path: root/apps/menu.c
diff options
context:
space:
mode:
Diffstat (limited to 'apps/menu.c')
-rw-r--r--apps/menu.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/apps/menu.c b/apps/menu.c
index e483ad7136..68b9d0dbe7 100644
--- a/apps/menu.c
+++ b/apps/menu.c
@@ -166,7 +166,7 @@ void menu_draw(int m)
166#endif 166#endif
167 /* Adjust cursor pos if it's below the screen */ 167 /* Adjust cursor pos if it's below the screen */
168 if (menus[m].cursor - menus[m].top >= menu_lines) 168 if (menus[m].cursor - menus[m].top >= menu_lines)
169 menus[m].top++; 169 menus[m].top = menus[m].cursor - (menu_lines - 1);
170 170
171 /* Adjust cursor pos if it's above the screen */ 171 /* Adjust cursor pos if it's above the screen */
172 if(menus[m].cursor < menus[m].top) 172 if(menus[m].cursor < menus[m].top)
@@ -508,3 +508,13 @@ bool menu_movedown(int menu)
508 508
509 return true; 509 return true;
510} 510}
511
512/*
513 * Allows to set the cursor position. Doesn't redraw by itself.
514 */
515
516void menu_set_cursor(int menu, int position)
517{
518 menus[menu].cursor = position;
519}
520