Backport changes to RGUI too

This commit is contained in:
twinaphex 2015-11-01 20:45:29 +01:00
parent 1e53e3e19a
commit b5855fa49c

View File

@ -840,28 +840,28 @@ static int rgui_environ(menu_environ_cb_t type, void *data)
return 0;
}
static int rgui_pointer_tap(menu_file_list_cbs_t *cbs,
static int rgui_pointer_tap(unsigned x, unsigned y,
unsigned ptr, menu_file_list_cbs_t *cbs,
menu_entry_t *entry, unsigned action)
{
size_t selection, idx;
unsigned header_height;
bool scroll = false;
menu_input_t *menu_input = menu_input_get_ptr();
menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection);
menu_display_ctl(MENU_DISPLAY_CTL_HEADER_HEIGHT, &header_height);
if ((unsigned)menu_input->pointer.start_y < header_height)
if (y < header_height)
{
menu_entries_pop_stack(&selection, 0);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &selection);
}
else if (menu_input->pointer.ptr <= (menu_entries_get_size() - 1))
else if (ptr <= (menu_entries_get_size() - 1))
{
if (menu_input->pointer.ptr == selection && cbs && cbs->action_select)
if (ptr == selection && cbs && cbs->action_select)
return menu_entry_action(entry, selection, MENU_ACTION_SELECT);
idx = menu_input->pointer.ptr;
idx = ptr;
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET_SELECTION, &idx);
menu_navigation_ctl(MENU_NAVIGATION_CTL_SET, &scroll);