jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=7c2671b1f7df2ef8d250720b703e5e8a29ee1a98

commit 7c2671b1f7df2ef8d250720b703e5e8a29ee1a98
Author: Jaehyun Cho <jae_hyun....@samsung.com>
Date:   Mon Sep 12 20:30:50 2016 +0900

    config: Add Escape key binding to naviframe.
    
    Naviframe item is popped when Escape key is pressed.
---
 config/default/base.src.in         |  8 +++++++-
 config/mobile/base.src.in          |  8 +++++++-
 config/standard/base.src.in        |  8 +++++++-
 src/lib/elementary/elc_naviframe.c | 19 +++++++++++++++++++
 4 files changed, 40 insertions(+), 3 deletions(-)

diff --git a/config/default/base.src.in b/config/default/base.src.in
index 089a4a4..9e05df6 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131083;
+  value "config_version" int: 131084;
   value "engine" string: "";
   value "vsync" uchar: 0;
   value "thumbscroll_enable" uchar: 1;
@@ -1987,6 +1987,12 @@ group "Elm_Config" struct {
               value "action" string: "top_item_get";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "item_pop";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index 8265f47..56c4f3f 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131083;
+  value "config_version" int: 131084;
   value "engine" string: "";
   value "vsync" uchar: 0;
   value "thumbscroll_enable" uchar: 1;
@@ -1991,6 +1991,12 @@ group "Elm_Config" struct {
               value "action" string: "top_item_get";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "item_pop";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 2bbb5aa..e628f82 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131083;
+  value "config_version" int: 131084;
   value "engine" string: "";
   value "vsync" uchar: 0;
   value "thumbscroll_enable" uchar: 0;
@@ -1988,6 +1988,12 @@ group "Elm_Config" struct {
               value "action" string: "top_item_get";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "item_pop";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/src/lib/elementary/elc_naviframe.c 
b/src/lib/elementary/elc_naviframe.c
index c447fda..4411f02 100644
--- a/src/lib/elementary/elc_naviframe.c
+++ b/src/lib/elementary/elc_naviframe.c
@@ -45,9 +45,11 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
 static void _on_item_back_btn_clicked(void *data, const Efl_Event *event);
 
 static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char 
*params);
+static Eina_Bool _key_action_item_pop(Evas_Object *obj, const char *params);
 
 static const Elm_Action key_actions[] = {
    {"top_item_get", _key_action_top_item_get},
+   {"item_pop", _key_action_item_pop},
    {NULL, NULL}
 };
 
@@ -1496,6 +1498,22 @@ _key_action_top_item_get(Evas_Object *obj, const char 
*params EINA_UNUSED)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
+{
+   Elm_Object_Item *eo_item = NULL;
+   eo_item = elm_naviframe_top_item_get(obj);
+   if (!eo_item) return EINA_FALSE;
+
+   ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
+
+   if (it->pushing || it->popping) return EINA_FALSE;
+
+   elm_naviframe_item_pop(obj);
+
+   return EINA_TRUE;
+}
+
 EOLIAN static Eina_Bool
 _elm_naviframe_elm_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, 
Evas_Object *src, Evas_Callback_Type type, void *event_info)
 {
@@ -1999,6 +2017,7 @@ 
_elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
 {
    static Elm_Atspi_Action atspi_actions[] = {
           { "top_item_get", "top_item_get", NULL, _key_action_top_item_get },
+          { "item_pop", "item_pop", NULL, _key_action_item_pop },
           { NULL, NULL, NULL, NULL }
    };
    return &atspi_actions[0];

-- 


Reply via email to