(Menu) Make disp_set_label work with any file_list

This commit is contained in:
Jean-André Santoni 2014-10-20 19:54:55 +02:00
parent 6562c2cd95
commit 2f988c300b
3 changed files with 5 additions and 4 deletions

View File

@ -303,7 +303,7 @@ static void glui_frame(void)
driver.menu->menu_list->selection_buf->list[i].label);
(void)setting;
disp_set_label(&w, type, i, label,
disp_set_label(driver.menu->menu_list->selection_buf, &w, type, i, label,
type_str, sizeof(type_str),
entry_label, path,
path_buf, sizeof(path_buf));

View File

@ -352,7 +352,7 @@ static void rgui_render(void)
driver.menu->menu_list->selection_buf->list[i].label);
(void)setting;
disp_set_label(&w, type, i, label,
disp_set_label(driver.menu->menu_list->selection_buf, &w, type, i, label,
type_str, sizeof(type_str),
entry_label, path,
path_buf, sizeof(path_buf));

View File

@ -129,7 +129,8 @@ static void get_title(const char *label, const char *dir,
}
}
static void disp_set_label(unsigned *w, unsigned type, unsigned i,
static void disp_set_label(file_list_t* list,
unsigned *w, unsigned type, unsigned i,
const char *label,
char *type_str, size_t type_str_size,
const char *entry_label,
@ -148,7 +149,7 @@ static void disp_set_label(unsigned *w, unsigned type, unsigned i,
if (type == MENU_FILE_CORE)
{
strlcpy(type_str, "(CORE)", type_str_size);
menu_list_get_alt_at_offset(driver.menu->menu_list->selection_buf, i, &path);
menu_list_get_alt_at_offset(list, i, &path);
*w = 6;
}
else if (type == MENU_FILE_PLAIN)