summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/menu.c12
-rw-r--r--apps/menu.h1
-rw-r--r--apps/recorder/radio.c2
3 files changed, 14 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
diff --git a/apps/menu.h b/apps/menu.h
index 1171f0efc5..046153b654 100644
--- a/apps/menu.h
+++ b/apps/menu.h
@@ -90,5 +90,6 @@ bool menu_moveup(int menu);
90bool menu_movedown(int menu); 90bool menu_movedown(int menu);
91void menu_draw(int menu); 91void menu_draw(int menu);
92void menu_insert(int menu, int position, char *desc, bool (*function) (void)); 92void menu_insert(int menu, int position, char *desc, bool (*function) (void));
93void menu_set_cursor(int menu, int position);
93 94
94#endif /* End __MENU_H__ */ 95#endif /* End __MENU_H__ */
diff --git a/apps/recorder/radio.c b/apps/recorder/radio.c
index 10a513f01f..59dd9dc37f 100644
--- a/apps/recorder/radio.c
+++ b/apps/recorder/radio.c
@@ -817,6 +817,8 @@ bool handle_radio_presets(void)
817 str(LANG_FM_BUTTONBAR_ADD), 817 str(LANG_FM_BUTTONBAR_ADD),
818 str(LANG_FM_BUTTONBAR_EXIT), 818 str(LANG_FM_BUTTONBAR_EXIT),
819 str(LANG_FM_BUTTONBAR_ACTION)); 819 str(LANG_FM_BUTTONBAR_ACTION));
820 if (curr_preset >= 0)
821 menu_set_cursor(preset_menu, curr_preset);
820 result = menu_show(preset_menu); 822 result = menu_show(preset_menu);
821 menu_exit(preset_menu); 823 menu_exit(preset_menu);
822 if (result == MENU_SELECTED_EXIT) 824 if (result == MENU_SELECTED_EXIT)