ajwillia-ms pushed a commit to branch master. http://git.enlightenment.org/tools/edi.git/commit/?id=09f572576e3e1c69a442ee1865b1877c803dcbae
commit 09f572576e3e1c69a442ee1865b1877c803dcbae Author: Andy Williams <a...@andywilliams.me> Date: Thu Jan 21 20:06:49 2016 +0000 [ui] Correctly focus popup inputs Work around an issue where a top level input cannot be focussed using the elm_focus API. --- src/bin/edi_main.c | 13 ++++++++++--- src/bin/mainview/edi_mainview.c | 13 ++++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/bin/edi_main.c b/src/bin/edi_main.c index 2fc705f..1f1ea80 100644 --- a/src/bin/edi_main.c +++ b/src/bin/edi_main.c @@ -524,16 +524,23 @@ _tb_new_create_cb(void *data, static void _edi_file_new() { - Evas_Object *popup, *input, *button; + Evas_Object *popup, *box, *input, *button; popup = elm_popup_add(_edi_main_win); _edi_new_popup = popup; elm_object_part_text_set(popup, "title,text", "Enter new file name"); - input = elm_entry_add(popup); + box = elm_box_add(popup); + elm_box_horizontal_set(box, EINA_FALSE); + elm_object_content_set(popup, box); + + input = elm_entry_add(box); elm_entry_single_line_set(input, EINA_TRUE); - elm_object_content_set(popup, input); + evas_object_size_hint_weight_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_align_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(input); + elm_box_pack_end(box, input); button = elm_button_add(popup); elm_object_text_set(button, "cancel"); diff --git a/src/bin/mainview/edi_mainview.c b/src/bin/mainview/edi_mainview.c index 2150792..c89df33 100644 --- a/src/bin/mainview/edi_mainview.c +++ b/src/bin/mainview/edi_mainview.c @@ -611,17 +611,24 @@ _edi_mainview_goto_popup_key_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED, void edi_mainview_goto_popup_show() { - Evas_Object *popup, *input, *button; + Evas_Object *popup, *box, *input, *button; popup = elm_popup_add(_main_win); _edi_mainview_goto_popup = popup; elm_object_part_text_set(popup, "title,text", "Enter line number"); - input = elm_entry_add(popup); + box = elm_box_add(popup); + elm_box_horizontal_set(box, EINA_FALSE); + elm_object_content_set(popup, box); + + input = elm_entry_add(box); elm_entry_single_line_set(input, EINA_TRUE); evas_object_event_callback_add(input, EVAS_CALLBACK_KEY_UP, _edi_mainview_goto_popup_key_up_cb, NULL); - elm_object_content_set(popup, input); + evas_object_size_hint_weight_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_size_hint_align_set(input, EVAS_HINT_FILL, EVAS_HINT_FILL); + evas_object_show(input); + elm_box_pack_end(box, input); button = elm_button_add(popup); elm_object_text_set(button, "cancel"); --