Revert "Refactor code to no longer need menu_navigation_get_ptr"
This reverts commit a7b83cfd45
.
This commit is contained in:
parent
2a719d2a9c
commit
40c6ec3790
|
@ -33,16 +33,11 @@
|
||||||
/* Clicks the back button */
|
/* Clicks the back button */
|
||||||
int menu_entry_go_back(void)
|
int menu_entry_go_back(void)
|
||||||
{
|
{
|
||||||
size_t new_selection_ptr;
|
|
||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||||
if (!menu_list)
|
if (!menu_list)
|
||||||
return -1;
|
return -1;
|
||||||
|
menu_list_pop_stack(menu_list, &nav->selection_ptr);
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
|
|
||||||
menu_list_pop_stack(menu_list, &new_selection_ptr);
|
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
|
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -354,7 +349,6 @@ int menu_entry_select(uint32_t i)
|
||||||
|
|
||||||
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
||||||
{
|
{
|
||||||
size_t new_selection_ptr;
|
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
menu_navigation_t *nav = menu_navigation_get_ptr();
|
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||||
menu_list_t *menu_list = menu_list_get_ptr();
|
menu_list_t *menu_list = menu_list_get_ptr();
|
||||||
|
@ -371,14 +365,10 @@ int menu_entry_action(menu_entry_t *entry, unsigned i, enum menu_action action)
|
||||||
ret = cbs->action_down(entry->type, entry->label);
|
ret = cbs->action_down(entry->type, entry->label);
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_SCROLL_UP:
|
case MENU_ACTION_SCROLL_UP:
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
|
menu_navigation_descend_alphabet(nav, &nav->selection_ptr);
|
||||||
menu_navigation_descend_alphabet(nav, &new_selection_ptr);
|
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
|
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_SCROLL_DOWN:
|
case MENU_ACTION_SCROLL_DOWN:
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
|
menu_navigation_ascend_alphabet(nav, &nav->selection_ptr);
|
||||||
menu_navigation_ascend_alphabet(nav, &new_selection_ptr);
|
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MENU_ACTION_CANCEL:
|
case MENU_ACTION_CANCEL:
|
||||||
|
|
|
@ -150,6 +150,7 @@ void menu_list_flush_stack(menu_list_t *list,
|
||||||
const char *label = NULL;
|
const char *label = NULL;
|
||||||
unsigned type = 0;
|
unsigned type = 0;
|
||||||
size_t entry_idx = 0;
|
size_t entry_idx = 0;
|
||||||
|
menu_navigation_t *nav = menu_navigation_get_ptr();
|
||||||
if (!list)
|
if (!list)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -160,12 +161,7 @@ void menu_list_flush_stack(menu_list_t *list,
|
||||||
while (menu_list_flush_stack_type(
|
while (menu_list_flush_stack_type(
|
||||||
needle, label, type, final_type) != 0)
|
needle, label, type, final_type) != 0)
|
||||||
{
|
{
|
||||||
size_t new_selection_ptr;
|
menu_list_pop(list->menu_stack, &nav->selection_ptr);
|
||||||
|
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &new_selection_ptr);
|
|
||||||
menu_list_pop(list->menu_stack, &new_selection_ptr);
|
|
||||||
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &new_selection_ptr);
|
|
||||||
|
|
||||||
menu_list_get_last(list->menu_stack,
|
menu_list_get_last(list->menu_stack,
|
||||||
&path, &label, &type, &entry_idx);
|
&path, &label, &type, &entry_idx);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue