netstar pushed a commit to branch master.

http://git.enlightenment.org/apps/evisum.git/commit/?id=9229ebed00567f0a58b3d887372fe42bd4665ba2

commit 9229ebed00567f0a58b3d887372fe42bd4665ba2
Author: Alastair Poole <nets...@gmail.com>
Date:   Fri Jan 22 15:19:06 2021 +0000

    about: escape close me.
    
    Crossing off personal annoyances.
---
 src/bin/ui/ui_util.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/src/bin/ui/ui_util.c b/src/bin/ui/ui_util.c
index 08be432..787cf0a 100644
--- a/src/bin/ui/ui_util.c
+++ b/src/bin/ui/ui_util.c
@@ -370,6 +370,22 @@ about_anim(void *data)
    return EINA_TRUE;
 }
 
+static void
+_win_key_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
+{
+   Evas_Event_Key_Down *ev;
+   Animate_Data *ad;
+
+   ad = data;
+   ev = event_info;
+
+   if (!ev || !ev->keyname)
+     return;
+
+   if (!strcmp(ev->keyname, "Escape"))
+     evas_object_del(ad->ui->win_about);
+}
+
 void
 evisum_about_window_show(void *data)
 {
@@ -537,6 +553,7 @@ evisum_about_window_show(void *data)
    elm_table_pack(tbl, rec, 0, 0, 1, 1);
    elm_table_pack(tbl, hbx, 0, 0, 1, 1);
    elm_object_content_set(win, tbl);
+   evas_object_event_callback_add(tbl, EVAS_CALLBACK_KEY_DOWN, 
_win_key_down_cb, about);
 
    evas_object_show(win);
 }

-- 


Reply via email to