elm_hoversel: add "escape" key action to dismiss 84/82684/3 accepted/tizen/common/20160811.145743 accepted/tizen/ivi/20160811.002916 accepted/tizen/mobile/20160811.002858 accepted/tizen/tv/20160811.002811 accepted/tizen/wearable/20160811.003100 submit/tizen/20160810.102033
authorPankaj Mittal <m.pankaj@samsung.com>
Fri, 5 Aug 2016 06:06:14 +0000 (11:36 +0530)
committerGerrit Code Review <gerrit@review.vlan103.tizen.org>
Wed, 10 Aug 2016 01:12:44 +0000 (18:12 -0700)
Summary:
To allow to dismiss hoversel expansion without selecting item
by key, "escape" key action is added.

Test Plan: elementary_test -to hoversel

Reviewers: Jee-Yong Um

Differential Revision: https://phab.enlightenment.org/D3627

Signed-off-by: Pankaj Mittal <m.pankaj@samsung.com>
Change-Id: Icb45fbc0a7fa7bf93e2feae3b8bfa45d78447f28

config/default/base.src.in
config/mobile/base.src.in
config/standard/base.src.in
src/lib/elc_hoversel.c

index 5c2e164..dd60b7c 100644 (file)
@@ -432,6 +432,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 {
index 7c25127..c884d26 100644 (file)
@@ -436,6 +436,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 {
index 83c8943..1290264 100644 (file)
@@ -433,6 +433,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 {
index ad0aa9f..72667a3 100644 (file)
@@ -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}
 };
 
@@ -893,6 +895,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)
 {
@@ -929,6 +938,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];