summaryrefslogtreecommitdiffstats
path: root/apps/menu.c
diff options
context:
space:
mode:
authorJens Arnold <amiconn@rockbox.org>2005-04-10 17:36:55 +0000
committerJens Arnold <amiconn@rockbox.org>2005-04-10 17:36:55 +0000
commitcef15c6efc2a0720a8b9b27cea036fc6ac82c829 (patch)
tree0d0471293e7d14b39a56084c7876f749d15248cf /apps/menu.c
parent06068b451d80a5949b080d756e082126245da180 (diff)
downloadrockbox-cef15c6efc2a0720a8b9b27cea036fc6ac82c829.tar.gz
rockbox-cef15c6efc2a0720a8b9b27cea036fc6ac82c829.zip
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
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)
#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;
+}
+