Create MENU_ENTRIES_CTL_REFRESH

This commit is contained in:
twinaphex 2016-02-04 21:13:38 +01:00
parent 2e8f015de3
commit 03199b564f
3 changed files with 11 additions and 6 deletions

View File

@ -3325,7 +3325,7 @@ void menu_displaylist_push_list_process(menu_displaylist_info_t *info)
file_list_sort_on_alt(info->list);
if (info->need_refresh)
menu_entries_refresh(info->list);
menu_entries_ctl(MENU_ENTRIES_CTL_REFRESH, info->list);
if (info->need_push)
{

View File

@ -317,13 +317,15 @@ static void menu_entries_build_scroll_indices(file_list_t *list)
*
* Ensure it doesn't overflow.
**/
void menu_entries_refresh(file_list_t *list)
static bool menu_entries_refresh(void *data)
{
size_t list_size, selection;
file_list_t *list = (file_list_t*)data;
if (!list)
return;
return false;
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
return;
return false;
menu_entries_build_scroll_indices(list);
@ -341,6 +343,8 @@ void menu_entries_refresh(file_list_t *list)
bool pending_push = true;
menu_navigation_ctl(MENU_NAVIGATION_CTL_CLEAR, &pending_push);
}
return true;
}
/* Returns the last index (+1) of the menu entry list. */
@ -715,6 +719,8 @@ bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data)
*idx = menu_entries_begin;
}
return true;
case MENU_ENTRIES_CTL_REFRESH:
return menu_entries_refresh(data);
case MENU_ENTRIES_CTL_INIT:
return menu_entries_init();
case MENU_ENTRIES_CTL_SHOW_BACK:

View File

@ -119,6 +119,7 @@ enum menu_entries_ctl_state
MENU_ENTRIES_CTL_SET_START,
/* Returns the starting index of the menu entry list. */
MENU_ENTRIES_CTL_START_GET,
MENU_ENTRIES_CTL_REFRESH,
MENU_ENTRIES_CTL_SHOW_BACK
};
@ -176,8 +177,6 @@ bool menu_entries_increment_menu_stack(void);
void menu_entries_push_selection_buf(file_list_t *list, const char *path, const char *label,
unsigned type, size_t directory_ptr, size_t entry_idx);
void menu_entries_refresh(file_list_t *list);
rarch_setting_t *menu_entries_get_setting(uint32_t i);
bool menu_entries_ctl(enum menu_entries_ctl_state state, void *data);