Create menu_navigation_get_current_selection

This commit is contained in:
twinaphex 2015-05-07 10:45:11 +02:00
parent 76011a9781
commit c8011632f9
2 changed files with 14 additions and 3 deletions

View File

@ -52,8 +52,9 @@ void menu_navigation_clear(menu_navigation_t *nav, bool pending_push)
**/
void menu_navigation_decrement(menu_navigation_t *nav, unsigned scroll_speed)
{
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
menu_list_t *menu_list = menu_list_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
if (!nav)
return;
@ -65,7 +66,7 @@ void menu_navigation_decrement(menu_navigation_t *nav, unsigned scroll_speed)
{
if (settings->menu.navigation.wraparound.vertical_enable)
menu_navigation_set(nav,
menu_list_get_size(menu->menu_list) - 1, true);
menu_list_get_size(menu_list) - 1, true);
else
menu_navigation_set(nav, 0, true);
}
@ -195,3 +196,11 @@ void menu_navigation_ascend_alphabet(menu_navigation_t *nav, size_t *ptr_out)
menu_driver_navigation_ascend_alphabet(ptr_out);
}
size_t menu_navigation_get_current_selection(void)
{
menu_navigation_t *nav = menu_navigation_get_ptr();
if (!nav)
return -1;
return nav->selection_ptr;
}

View File

@ -87,6 +87,8 @@ void menu_navigation_descend_alphabet(menu_navigation_t *nav, size_t *ptr_out);
**/
void menu_navigation_ascend_alphabet(menu_navigation_t *nav, size_t *ptr_out);
size_t menu_navigation_get_current_selection(void);
#ifdef __cplusplus
}
#endif