(XMB) Honor navigation wraparound horizontal setting

This commit is contained in:
Jean-André Santoni 2015-10-25 02:18:47 +07:00
parent 8cf458a7dc
commit 4b47958999
3 changed files with 23 additions and 11 deletions

View File

@ -130,6 +130,7 @@ static int action_left_mainmenu(unsigned type, const char *label,
unsigned push_list = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr();
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
settings_t *settings = config_get_ptr();
menu_handle_t *menu = menu_driver_get_ptr();
unsigned action = MENU_ACTION_LEFT;
size_t list_size = menu_driver_list_get_size(MENU_LIST_PLAIN);
@ -139,7 +140,8 @@ static int action_left_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() != 0)
if (menu_driver_list_get_selection() != 0
|| settings->menu.navigation.wraparound.horizontal_enable)
push_list = 1;
}
else

View File

@ -158,13 +158,15 @@ static int action_right_mainmenu(unsigned type, const char *label,
unsigned push_list = 0;
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr();
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
settings_t *settings = config_get_ptr();
unsigned action = MENU_ACTION_RIGHT;
size_t list_size = menu_driver_list_get_size(MENU_LIST_PLAIN);
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) + 3)
|| settings->menu.navigation.wraparound.horizontal_enable)
push_list = 1;
}
else

View File

@ -2442,6 +2442,7 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
size_t stack_size, list_size, selection;
xmb_handle_t *xmb = NULL;
menu_handle_t *menu = menu_driver_get_ptr();
settings_t *settings = config_get_ptr();
file_list_t *menu_stack = menu_entries_get_menu_stack_ptr();
file_list_t *selection_buf = menu_entries_get_selection_buf_ptr();
@ -2459,6 +2460,8 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
xmb_list_deep_copy(menu, menu_stack, xmb->menu_stack_old);
xmb->selection_ptr_old = selection;
list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + XMB_SYSTEM_TAB_END;
switch (type)
{
case MENU_LIST_PLAIN:
@ -2469,20 +2472,25 @@ static void xmb_list_cache(menu_list_type_t type, unsigned action)
switch (action)
{
case MENU_ACTION_LEFT:
xmb->categories.selection_ptr--;
if (xmb->categories.selection_ptr == 0)
{
xmb->categories.selection_ptr = list_size;
xmb->categories.active.idx = list_size - 1;
}
else
xmb->categories.selection_ptr--;
break;
default:
xmb->categories.selection_ptr++;
if (xmb->categories.selection_ptr == list_size)
{
xmb->categories.selection_ptr = 0;
xmb->categories.active.idx = 1;
}
else
xmb->categories.selection_ptr++;
break;
}
list_size = xmb_list_get_size(menu, MENU_LIST_HORIZONTAL) + XMB_SYSTEM_TAB_END;
if (xmb->categories.selection_ptr > list_size)
{
xmb->categories.selection_ptr = list_size;
return;
}
stack_size = menu_stack->size;
if (menu_stack->list[stack_size - 1].label)