Implement Navigation Wrap-Around Vertical

This commit is contained in:
twinaphex 2015-01-25 06:01:30 +01:00
parent 30b8fd3ac3
commit d080c74464

View File

@ -1196,11 +1196,9 @@ static int action_toggle_scroll(unsigned type, const char *label,
if (!driver.menu)
return -1;
scroll_speed = (max(driver.menu->scroll_accel, 2) - 2) / 4 + 1;
scroll_speed = (max(driver.menu->scroll_accel, 2) - 2) / 4 + 1;
fast_scroll_speed = 4 + 4 * scroll_speed;
(void)scroll_speed;
switch (action)
{
case MENU_ACTION_LEFT:
@ -2582,15 +2580,27 @@ static int action_bind_up_or_down_generic(unsigned type, const char *label,
menu_navigation_set(driver.menu,
driver.menu->selection_ptr - scroll_speed, true);
else
menu_navigation_set(driver.menu,
menu_list_get_size(driver.menu->menu_list) - 1, true);
{
if (g_settings.menu.navigation.wraparound.vertical_enable)
menu_navigation_set(driver.menu,
menu_list_get_size(driver.menu->menu_list) - 1, true);
else
menu_navigation_set(driver.menu,
0, true);
}
break;
case MENU_ACTION_DOWN:
if (driver.menu->selection_ptr + scroll_speed < (menu_list_get_size(driver.menu->menu_list)))
menu_navigation_set(driver.menu,
driver.menu->selection_ptr + scroll_speed, true);
else
menu_navigation_clear(driver.menu, false);
{
if (g_settings.menu.navigation.wraparound.vertical_enable)
menu_navigation_clear(driver.menu, false);
else
menu_navigation_set(driver.menu,
menu_list_get_size(driver.menu->menu_list) - 1, true);
}
break;
}