rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=66256cd5a3e5a22ce95dcba984d716fb6708e84c

commit 66256cd5a3e5a22ce95dcba984d716fb6708e84c
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Tue Dec 13 18:25:50 2016 +0200

    popup: handle keys 'Enter' and 'Esc' for popup
    
    Change-Id: Icc2c045ef5ae7585da9411efa87cca4c5d74be46
---
 src/bin/ui/popup.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

diff --git a/src/bin/ui/popup.c b/src/bin/ui/popup.c
index e817075..a90b43f 100644
--- a/src/bin/ui/popup.c
+++ b/src/bin/ui/popup.c
@@ -127,6 +127,19 @@ _button_add(Popup_Data *pd, int *btn_pos, const char 
*text, Popup_Button pb)
    return btn;
 }
 
+static void
+_popup_button_click(void *data,
+                    Evas_Object *obj __UNUSED__,
+                    void *event_info __UNUSED__)
+{
+   Evas_Object *btn = data;
+
+   assert(btn != NULL);
+
+   if (!elm_object_disabled_get(btn))
+     evas_object_smart_callback_call(btn, signals.elm.button.clicked, NULL);
+}
+
 Evas_Object *
 popup_add(const char *title,
           const char *msg,
@@ -155,6 +168,11 @@ popup_add(const char *title,
    pd->button.cancel    = _button_add(pd, &bt_num, _("Cancel"),     popup_btns 
& BTN_CANCEL);
    pd->button.reset     = _button_add(pd, &bt_num, _("Reset"),      popup_btns 
& BTN_RESET);
 
+   if (pd->button.ok)
+     evas_object_smart_callback_add(pd->popup, signals.shortcut.popup.done, 
_popup_button_click, pd->button.ok);
+   if (pd->button.cancel)
+     evas_object_smart_callback_add(pd->popup, signals.shortcut.popup.cancel, 
_popup_button_click, pd->button.cancel);
+
    if (msg)
      elm_object_text_set(pd->popup, msg);
    else /* content_get != NULL */

-- 


Reply via email to