Cleanups for left/right callbacks

This commit is contained in:
twinaphex 2017-02-22 06:00:50 +01:00
parent d61d55e3ea
commit c72311a708
2 changed files with 16 additions and 17 deletions

View File

@ -148,13 +148,8 @@ static int action_left_mainmenu(unsigned type, const char *label,
{
menu_ctx_list_t list_info;
size_t selection = 0;
menu_file_list_cbs_t *cbs = NULL;
unsigned push_list = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
settings_t *settings = config_get_ptr();
menu_handle_t *menu = NULL;
unsigned action = MENU_ACTION_LEFT;
if (!menu_driver_ctl(RARCH_MENU_CTL_DRIVER_DATA_GET, &menu))
return menu_cbs_exit();
@ -167,6 +162,8 @@ static int action_left_mainmenu(unsigned type, const char *label,
if (list_info.size == 1)
{
settings_t *settings = config_get_ptr();
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
if ((list_info.selection != 0)
|| settings->menu.navigation.wraparound.enable)
@ -177,17 +174,20 @@ static int action_left_mainmenu(unsigned type, const char *label,
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
cbs = menu_entries_get_actiondata_at_offset(selection_buf,
selection);
switch (push_list)
{
case 1:
{
menu_ctx_list_t list_info;
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
menu_file_list_cbs_t *cbs =
menu_entries_get_actiondata_at_offset(selection_buf,
selection);
list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = action;
list_info.action = MENU_ACTION_LEFT;
menu_driver_ctl(RARCH_MENU_CTL_LIST_CACHE, &list_info);

View File

@ -158,12 +158,7 @@ static int action_right_mainmenu(unsigned type, const char *label,
{
menu_ctx_list_t list_info;
size_t selection = 0;
menu_file_list_cbs_t *cbs = NULL;
unsigned push_list = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
settings_t *settings = config_get_ptr();
unsigned action = MENU_ACTION_RIGHT;
menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SELECTION, &list_info);
@ -175,9 +170,10 @@ static int action_right_mainmenu(unsigned type, const char *label,
{
menu_ctx_list_t list_horiz_info;
menu_ctx_list_t list_tabs_info;
settings_t *settings = config_get_ptr();
list_horiz_info.type = MENU_LIST_HORIZONTAL;
list_tabs_info.type = MENU_LIST_TABS;
list_horiz_info.type = MENU_LIST_HORIZONTAL;
list_tabs_info.type = MENU_LIST_TABS;
menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SIZE, &list_horiz_info);
menu_driver_ctl(RARCH_MENU_CTL_LIST_GET_SIZE, &list_tabs_info);
@ -193,16 +189,19 @@ static int action_right_mainmenu(unsigned type, const char *label,
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
cbs = menu_entries_get_actiondata_at_offset(selection_buf, selection);
switch (push_list)
{
case 1:
{
menu_ctx_list_t list_info;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr(0);
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr(0);
menu_file_list_cbs_t *cbs = menu_entries_get_actiondata_at_offset(
selection_buf, selection);
list_info.type = MENU_LIST_HORIZONTAL;
list_info.action = action;
list_info.action = MENU_ACTION_RIGHT;
menu_driver_ctl(RARCH_MENU_CTL_LIST_CACHE, &list_info);