forked from enlightenment/edi
[ui] Correctly focus popup inputs
Work around an issue where a top level input cannot be focussed using the elm_focus API.
This commit is contained in:
parent
a9d9d32797
commit
09f572576e
|
@ -524,16 +524,23 @@ _tb_new_create_cb(void *data,
|
||||||
static void
|
static void
|
||||||
_edi_file_new()
|
_edi_file_new()
|
||||||
{
|
{
|
||||||
Evas_Object *popup, *input, *button;
|
Evas_Object *popup, *box, *input, *button;
|
||||||
|
|
||||||
popup = elm_popup_add(_edi_main_win);
|
popup = elm_popup_add(_edi_main_win);
|
||||||
_edi_new_popup = popup;
|
_edi_new_popup = popup;
|
||||||
elm_object_part_text_set(popup, "title,text",
|
elm_object_part_text_set(popup, "title,text",
|
||||||
"Enter new file name");
|
"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_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);
|
button = elm_button_add(popup);
|
||||||
elm_object_text_set(button, "cancel");
|
elm_object_text_set(button, "cancel");
|
||||||
|
|
|
@ -611,17 +611,24 @@ _edi_mainview_goto_popup_key_up_cb(void *data EINA_UNUSED, Evas *e EINA_UNUSED,
|
||||||
void
|
void
|
||||||
edi_mainview_goto_popup_show()
|
edi_mainview_goto_popup_show()
|
||||||
{
|
{
|
||||||
Evas_Object *popup, *input, *button;
|
Evas_Object *popup, *box, *input, *button;
|
||||||
|
|
||||||
popup = elm_popup_add(_main_win);
|
popup = elm_popup_add(_main_win);
|
||||||
_edi_mainview_goto_popup = popup;
|
_edi_mainview_goto_popup = popup;
|
||||||
elm_object_part_text_set(popup, "title,text",
|
elm_object_part_text_set(popup, "title,text",
|
||||||
"Enter line number");
|
"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);
|
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);
|
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);
|
button = elm_button_add(popup);
|
||||||
elm_object_text_set(button, "cancel");
|
elm_object_text_set(button, "cancel");
|
||||||
|
|
Loading…
Reference in New Issue