forked from enlightenment/efl
fileselector: enter key press in name entry acts like ok button click.
- I used "activate" signal of entry and this will call ok button clicked function directly. - This is very useful when the fileselector is used in desktop with keyboard.
This commit is contained in:
parent
dfa71ce06b
commit
106db03a94
|
@ -1270,6 +1270,13 @@ _resource_deleted(void *data, int type EINA_UNUSED, void *ev)
|
||||||
return ECORE_CALLBACK_PASS_ON;
|
return ECORE_CALLBACK_PASS_ON;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_name_entry_activated_cb(void *data, Evas_Object *obj EINA_UNUSED,
|
||||||
|
void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
_ok(data, NULL, NULL);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
_elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
{
|
{
|
||||||
|
@ -1360,6 +1367,8 @@ _elm_fileselector_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
|
||||||
elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
|
elm_entry_line_wrap_set(en, ELM_WRAP_CHAR);
|
||||||
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
evas_object_size_hint_weight_set(en, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
|
||||||
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
evas_object_size_hint_align_set(en, EVAS_HINT_FILL, EVAS_HINT_FILL);
|
||||||
|
evas_object_smart_callback_add(en, "activated",
|
||||||
|
_name_entry_activated_cb, obj);
|
||||||
|
|
||||||
elm_widget_sub_object_add(obj, en);
|
elm_widget_sub_object_add(obj, en);
|
||||||
priv->name_entry = en;
|
priv->name_entry = en;
|
||||||
|
|
Loading…
Reference in New Issue