diff --git a/menu/menu_navigation.c b/menu/menu_navigation.c index cd43fc8a7a..77b5de3ee8 100644 --- a/menu/menu_navigation.c +++ b/menu/menu_navigation.c @@ -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; +} diff --git a/menu/menu_navigation.h b/menu/menu_navigation.h index 5c34c0e89e..7f67d694be 100644 --- a/menu/menu_navigation.h +++ b/menu/menu_navigation.h @@ -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