From: Sergey Semernin <sergey.semernin@gmail.com>
In E_Dialog space key grabbed before than keydown event reach to entry widget in E_Entry_Dialog. Thus, I forced ungrab space key in e_entry_dialog_show constructor. Moreover, I added escape key handling in _e_entry_cb_key_down callback. I do not delete space key grub in E_Dialog, because, I think, it may be usefull here, when we need selecting controls with space. Or not? SVN revision: 39936
This commit is contained in:
parent
992597240a
commit
5c62d98898
|
@ -18,6 +18,7 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text,
|
||||||
E_Entry_Dialog *ed;
|
E_Entry_Dialog *ed;
|
||||||
E_Dialog *dia;
|
E_Dialog *dia;
|
||||||
Evas_Object *o, *ob;
|
Evas_Object *o, *ob;
|
||||||
|
Evas_Modifier_Mask mask;
|
||||||
int w, h;
|
int w, h;
|
||||||
|
|
||||||
ed = E_OBJECT_ALLOC(E_Entry_Dialog, E_ENTRY_DIALOG_TYPE, _e_entry_dialog_free);
|
ed = E_OBJECT_ALLOC(E_Entry_Dialog, E_ENTRY_DIALOG_TYPE, _e_entry_dialog_free);
|
||||||
|
@ -37,6 +38,9 @@ e_entry_dialog_show(const char *title, const char *icon, const char *text,
|
||||||
dia->data = ed;
|
dia->data = ed;
|
||||||
ed->dia = dia;
|
ed->dia = dia;
|
||||||
|
|
||||||
|
mask = 0;
|
||||||
|
evas_object_key_ungrab(dia->event_object, "space", mask, ~mask);
|
||||||
|
|
||||||
e_win_delete_callback_set(dia->win, _e_entry_dialog_delete);
|
e_win_delete_callback_set(dia->win, _e_entry_dialog_delete);
|
||||||
|
|
||||||
if (title) e_dialog_title_set(dia, title);
|
if (title) e_dialog_title_set(dia, title);
|
||||||
|
@ -116,10 +120,10 @@ _e_entry_cb_key_down(void *data, Evas_Object *obj, void *event_info)
|
||||||
E_Entry_Dialog *ed;
|
E_Entry_Dialog *ed;
|
||||||
|
|
||||||
ev = event_info;
|
ev = event_info;
|
||||||
if (strcmp(ev->keyname, "Return")) return;
|
|
||||||
if (!(ed = data)) return;
|
if (!(ed = data)) return;
|
||||||
e_object_ref(E_OBJECT(ed));
|
if (!strcmp(ev->keyname, "Return"))
|
||||||
if (ed->ok.func) ed->ok.func(ed->text, ed->ok.data);
|
_e_entry_dialog_ok(data, ed->dia);
|
||||||
e_object_del(E_OBJECT(ed));
|
else
|
||||||
e_object_unref(E_OBJECT(ed));
|
if (!strcmp(ev->keyname, "Escape"))
|
||||||
|
_e_entry_dialog_cancel(data, ed->dia);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue