Reimplement pending_action OK

This commit is contained in:
twinaphex 2016-02-28 18:35:34 +01:00
parent 841a647d0c
commit f13b630d57
1 changed files with 3 additions and 22 deletions

View File

@ -110,11 +110,6 @@ typedef struct zarch_handle
gfx_font_raster_block_t tmp_block; gfx_font_raster_block_t tmp_block;
unsigned hash; unsigned hash;
struct {
bool enable;
size_t idx;
} pending_action_ok;
struct { struct {
unsigned active; unsigned active;
unsigned hot; unsigned hot;
@ -680,12 +675,10 @@ static int zarch_zui_render_lay_root_recent(zui_t *zui, zui_tabbed_t *tabbed)
tabbed->tabline_size + j * ZUI_ITEM_SIZE_PX, tabbed->tabline_size + j * ZUI_ITEM_SIZE_PX,
entry.path, i, entry.value, gamepad_index == i)) entry.path, i, entry.value, gamepad_index == i))
{ {
zui->pending_action_ok.enable = true; if (menu_entry_action(&entry, i, MENU_ACTION_OK))
zui->pending_action_ok.idx = i; return 1;
return 1;
} }
j++; j++;
} }
@ -1280,19 +1273,7 @@ static int zarch_iterate(void *data, void *userdata, enum menu_action action)
menu_entry_get(&entry, 0, action_id, NULL, false); menu_entry_get(&entry, 0, action_id, NULL, false);
if (zui->pending_action_ok.enable) zui->action = action;
{
menu_entry_get(&entry, 0, zui->pending_action_ok.idx, NULL, false);
zui->pending_action_ok.enable = false;
action = MENU_ACTION_OK;
action_id = zui->pending_action_ok.idx;
zui->pending_action_ok.idx = 0;
}
else
{
zui->action = action;
}
if (perform_action) if (perform_action)
ret = menu_entry_action(&entry, action_id, action); ret = menu_entry_action(&entry, action_id, action);