Merge pull request #2317 from lakkatv/material

(GLUI) Fix left tab switching when navigation wraparound is false. Al…
This commit is contained in:
Twinaphex 2015-10-30 10:31:29 +01:00
commit a6f86a6d50
5 changed files with 36 additions and 8 deletions

View File

@ -165,7 +165,9 @@ static int action_right_mainmenu(unsigned type, const char *label,
if (list_size == 1)
{
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
if (menu_driver_list_get_selection() != (menu_driver_list_get_size(MENU_LIST_HORIZONTAL) + 3)
if (menu_driver_list_get_selection() !=
(menu_driver_list_get_size(MENU_LIST_HORIZONTAL)
+ menu_driver_list_get_size(MENU_LIST_TABS))
|| settings->menu.navigation.wraparound.enable)
push_list = 1;
}

View File

@ -603,12 +603,17 @@ static size_t glui_list_get_size(void *data, menu_list_type_t type)
{
size_t list_size = 0;
/*switch (type)
switch (type)
{
case MENU_LIST_PLAIN:*/
case MENU_LIST_PLAIN:
list_size = menu_entries_get_stack_size(0);
/*break;
}*/
break;
case MENU_LIST_TABS:
list_size = GLUI_SYSTEM_TAB_END;
break;
default:
break;
}
return list_size;
}
@ -1237,6 +1242,8 @@ static void glui_list_cache(menu_list_type_t type, unsigned action)
break;
}
break;
default:
break;
}
}
@ -1300,6 +1307,17 @@ static int glui_list_push(menu_displaylist_info_t *info, unsigned type)
return ret;
}
static size_t glui_list_get_selection(void *data)
{
menu_handle_t *menu = (menu_handle_t*)data;
glui_handle_t *glui = menu ? (glui_handle_t*)menu->userdata : NULL;
if (!glui)
return 0;
return glui->categories.selection_ptr;
}
menu_ctx_driver_t menu_ctx_glui = {
NULL,
glui_get_message,
@ -1325,7 +1343,7 @@ menu_ctx_driver_t menu_ctx_glui = {
NULL,
glui_list_cache,
glui_list_push,
NULL,
glui_list_get_selection,
glui_list_get_size,
NULL,
glui_list_set_selection,

View File

@ -312,6 +312,8 @@ static size_t xmb_list_get_size(void *data, menu_list_type_t type)
if (xmb && xmb->horizontal_list)
list_size = file_list_get_size(xmb->horizontal_list);
break;
case MENU_LIST_TABS:
list_size = XMB_SYSTEM_TAB_END;
}
return list_size;
@ -338,6 +340,8 @@ static void *xmb_list_get_entry(void *data, menu_list_type_t type, unsigned i)
if (i < list_size)
ptr = (void*)&xmb->horizontal_list->list[i];
break;
default:
break;
}
return ptr;
@ -2584,6 +2588,8 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
break;
}
break;
default:
break;
}
}

View File

@ -1604,7 +1604,8 @@ static int menu_displaylist_parse_horizontal_list(menu_displaylist_info_t *info)
settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
struct item_file *item = (struct item_file*)
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL, menu_driver_list_get_selection() - 4);
menu_driver_list_get_entry(MENU_LIST_HORIZONTAL,
menu_driver_list_get_selection() - (menu_driver_list_get_size(MENU_LIST_TABS)+1));
if (!item)
return -1;

View File

@ -31,7 +31,8 @@ extern "C" {
typedef enum
{
MENU_LIST_PLAIN = 0,
MENU_LIST_HORIZONTAL
MENU_LIST_HORIZONTAL,
MENU_LIST_TABS
} menu_list_type_t;
typedef struct menu_file_list_cbs