hermet pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=ef66bd86700476ba47c91bb2affb7398f9ba7f03

commit ef66bd86700476ba47c91bb2affb7398f9ba7f03
Author: Jee-Yong Um <jc9...@samsung.com>
Date:   Tue Feb 2 19:57:20 2016 +0900

    elm_hoversel: add "escape" key action to dismiss
    
    Summary:
    To allow to dismiss hoversel expansion without selecting item
    by key, "escape" key action is added.
    
    Test Plan: elementary_test -to hoversel
    
    Reviewers: Jaehyun_Cho, cedric, divyesh
    
    Reviewed By: divyesh
    
    Differential Revision: https://phab.enlightenment.org/D3627
---
 config/default/base.src.in  |  6 ++++++
 config/mobile/base.src.in   |  6 ++++++
 config/standard/base.src.in |  6 ++++++
 src/lib/elc_hoversel.c      | 10 ++++++++++
 4 files changed, 28 insertions(+)

diff --git a/config/default/base.src.in b/config/default/base.src.in
index e86f7d8..6a488c4 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -430,6 +430,12 @@ group "Elm_Config" struct {
               value "action" string: "activate";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "escape";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index a588aa1..d3ec42e 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -434,6 +434,12 @@ group "Elm_Config" struct {
               value "action" string: "activate";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "escape";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 0bb42ce..6e8196c 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -431,6 +431,12 @@ group "Elm_Config" struct {
               value "action" string: "activate";
               value "params" string: "";
            }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Escape";
+              value "action" string: "escape";
+              value "params" string: "";
+           }
         }
      }
      group "Elm_Config_Bindings_Widget" struct {
diff --git a/src/lib/elc_hoversel.c b/src/lib/elc_hoversel.c
index 2dfb587..b089f4f 100644
--- a/src/lib/elc_hoversel.c
+++ b/src/lib/elc_hoversel.c
@@ -35,10 +35,12 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = 
{
 
 static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
 static Eina_Bool _key_action_activate(Evas_Object *obj, const char *params);
+static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
 
 static const Elm_Action key_actions[] = {
    {"move", _key_action_move},
    {"activate", _key_action_activate},
+   {"escape", _key_action_escape},
    {NULL, NULL}
 };
 
@@ -914,6 +916,13 @@ _key_action_activate(Evas_Object *obj, const char *params 
EINA_UNUSED)
    return EINA_TRUE;
 }
 
+static Eina_Bool
+_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
+{
+   elm_hoversel_hover_end(obj);
+   return EINA_TRUE;
+}
+
 EOLIAN static Eina_Bool
 _elm_hoversel_elm_widget_event(Eo *obj, Elm_Hoversel_Data *sd, Evas_Object 
*src, Evas_Callback_Type type, void *event_info)
 {
@@ -950,6 +959,7 @@ 
_elm_hoversel_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
           { "move,down", "move", "down", _key_action_move},
           { "move,left", "move", "left", _key_action_move},
           { "move,right", "move", "right", _key_action_move},
+          { "escape", "escape", NULL, _key_action_escape},
           { NULL, NULL, NULL, NULL}
    };
    return &atspi_actions[0];

-- 


Reply via email to