fileselector: Remove usage of eo evas object events
This commit is contained in:
parent
1e82603013
commit
77bd2819b9
|
@ -1541,25 +1541,24 @@ _anchor_clicked(void *data, const Eo_Event *event)
|
||||||
static Eina_Bool
|
static Eina_Bool
|
||||||
_files_key_down(void *data, const Eo_Event *event)
|
_files_key_down(void *data, const Eo_Event *event)
|
||||||
{
|
{
|
||||||
Evas_Event_Key_Down *ev = event->info;
|
Efl_Event_Key *ev = event->info;
|
||||||
Evas_Object *par, *searchbar;
|
Evas_Object *par, *searchbar;
|
||||||
|
const char *string, *key;
|
||||||
|
|
||||||
par = data;
|
par = data;
|
||||||
searchbar = evas_object_data_get(par, "search");
|
searchbar = evas_object_data_get(par, "search");
|
||||||
|
|
||||||
if (!searchbar) return EINA_TRUE;
|
if (!searchbar) return EINA_TRUE;
|
||||||
|
|
||||||
if (((ev->string) && *(ev->string) &&
|
key = efl_event_key_get(ev);
|
||||||
(isalpha(*ev->string) ||
|
string = efl_event_key_string_get(ev);
|
||||||
isdigit(*ev->string))))
|
if (string && *(string) && (isalpha(*string) || isdigit(*string)))
|
||||||
{
|
{
|
||||||
|
|
||||||
elm_entry_entry_append(searchbar, ev->string);
|
elm_entry_entry_append(searchbar, string);
|
||||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
efl_event_processed_set(ev, EINA_TRUE);
|
||||||
}
|
}
|
||||||
else if (ev->string &&
|
else if (key && *(key) && !strcmp(key, "BackSpace"))
|
||||||
*(ev->string) &&
|
|
||||||
!strcmp(ev->key, "BackSpace"))
|
|
||||||
{
|
{
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
const char *en;
|
const char *en;
|
||||||
|
@ -1569,7 +1568,7 @@ _files_key_down(void *data, const Eo_Event *event)
|
||||||
memmove(buf, en, strlen(en) -1);
|
memmove(buf, en, strlen(en) -1);
|
||||||
buf[strlen(en) -1] = '\0';
|
buf[strlen(en) -1] = '\0';
|
||||||
elm_entry_entry_set(searchbar, buf);
|
elm_entry_entry_set(searchbar, buf);
|
||||||
ev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
|
efl_event_processed_set(ev, EINA_TRUE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1600,7 +1599,7 @@ _files_list_add(Evas_Object *obj)
|
||||||
eo_event_callback_add
|
eo_event_callback_add
|
||||||
(li, ELM_GENLIST_EVENT_CONTRACTED, _on_list_contracted, obj);
|
(li, ELM_GENLIST_EVENT_CONTRACTED, _on_list_contracted, obj);
|
||||||
eo_event_callback_add
|
eo_event_callback_add
|
||||||
(li, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj);
|
(li, EFL_EVENT_KEY_DOWN, _files_key_down, obj);
|
||||||
|
|
||||||
return li;
|
return li;
|
||||||
}
|
}
|
||||||
|
@ -1629,7 +1628,7 @@ _files_grid_add(Evas_Object *obj)
|
||||||
eo_event_callback_add
|
eo_event_callback_add
|
||||||
(grid, ELM_GENGRID_EVENT_ACTIVATED, _on_item_activated, obj);
|
(grid, ELM_GENGRID_EVENT_ACTIVATED, _on_item_activated, obj);
|
||||||
eo_event_callback_add
|
eo_event_callback_add
|
||||||
(grid, EVAS_OBJECT_EVENT_KEY_DOWN, _files_key_down, obj);
|
(grid, EFL_EVENT_KEY_DOWN, _files_key_down, obj);
|
||||||
|
|
||||||
return grid;
|
return grid;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue