summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaehyun Cho <jae_hyun.cho@samsung.com>2016-09-12 20:30:50 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2016-09-12 20:51:04 +0900
commit7c2671b1f7df2ef8d250720b703e5e8a29ee1a98 (patch)
treee917a5de1d3258750224656bf7d9b0a3874dba47
parenta098ea0f3da5310f1e3d78315af72558c6830435 (diff)
config: Add Escape key binding to naviframe.
Naviframe item is popped when Escape key is pressed.
-rw-r--r--config/default/base.src.in8
-rw-r--r--config/mobile/base.src.in8
-rw-r--r--config/standard/base.src.in8
-rw-r--r--src/lib/elementary/elc_naviframe.c19
4 files changed, 40 insertions, 3 deletions
diff --git a/config/default/base.src.in b/config/default/base.src.in
index 089a4a4e30..9e05df6e19 100644
--- a/config/default/base.src.in
+++ b/config/default/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131083; 2 value "config_version" int: 131084;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 1; 5 value "thumbscroll_enable" uchar: 1;
@@ -1987,6 +1987,12 @@ group "Elm_Config" struct {
1987 value "action" string: "top_item_get"; 1987 value "action" string: "top_item_get";
1988 value "params" string: ""; 1988 value "params" string: "";
1989 } 1989 }
1990 group "Elm_Config_Binding_Key" struct {
1991 value "context" int: 0;
1992 value "key" string: "Escape";
1993 value "action" string: "item_pop";
1994 value "params" string: "";
1995 }
1990 } 1996 }
1991 } 1997 }
1992 group "Elm_Config_Bindings_Widget" struct { 1998 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in
index 8265f47873..56c4f3fbf3 100644
--- a/config/mobile/base.src.in
+++ b/config/mobile/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131083; 2 value "config_version" int: 131084;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 1; 5 value "thumbscroll_enable" uchar: 1;
@@ -1991,6 +1991,12 @@ group "Elm_Config" struct {
1991 value "action" string: "top_item_get"; 1991 value "action" string: "top_item_get";
1992 value "params" string: ""; 1992 value "params" string: "";
1993 } 1993 }
1994 group "Elm_Config_Binding_Key" struct {
1995 value "context" int: 0;
1996 value "key" string: "Escape";
1997 value "action" string: "item_pop";
1998 value "params" string: "";
1999 }
1994 } 2000 }
1995 } 2001 }
1996 group "Elm_Config_Bindings_Widget" struct { 2002 group "Elm_Config_Bindings_Widget" struct {
diff --git a/config/standard/base.src.in b/config/standard/base.src.in
index 2bbb5aa1f7..e628f8274d 100644
--- a/config/standard/base.src.in
+++ b/config/standard/base.src.in
@@ -1,5 +1,5 @@
1group "Elm_Config" struct { 1group "Elm_Config" struct {
2 value "config_version" int: 131083; 2 value "config_version" int: 131084;
3 value "engine" string: ""; 3 value "engine" string: "";
4 value "vsync" uchar: 0; 4 value "vsync" uchar: 0;
5 value "thumbscroll_enable" uchar: 0; 5 value "thumbscroll_enable" uchar: 0;
@@ -1988,6 +1988,12 @@ group "Elm_Config" struct {
1988 value "action" string: "top_item_get"; 1988 value "action" string: "top_item_get";
1989 value "params" string: ""; 1989 value "params" string: "";
1990 } 1990 }
1991 group "Elm_Config_Binding_Key" struct {
1992 value "context" int: 0;
1993 value "key" string: "Escape";
1994 value "action" string: "item_pop";
1995 value "params" string: "";
1996 }
1991 } 1997 }
1992 } 1998 }
1993 group "Elm_Config_Bindings_Widget" struct { 1999 group "Elm_Config_Bindings_Widget" struct {
diff --git a/src/lib/elementary/elc_naviframe.c b/src/lib/elementary/elc_naviframe.c
index c447fdaec7..4411f02998 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[] = {
45static void _on_item_back_btn_clicked(void *data, const Efl_Event *event); 45static void _on_item_back_btn_clicked(void *data, const Efl_Event *event);
46 46
47static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params); 47static Eina_Bool _key_action_top_item_get(Evas_Object *obj, const char *params);
48static Eina_Bool _key_action_item_pop(Evas_Object *obj, const char *params);
48 49
49static const Elm_Action key_actions[] = { 50static const Elm_Action key_actions[] = {
50 {"top_item_get", _key_action_top_item_get}, 51 {"top_item_get", _key_action_top_item_get},
52 {"item_pop", _key_action_item_pop},
51 {NULL, NULL} 53 {NULL, NULL}
52}; 54};
53 55
@@ -1496,6 +1498,22 @@ _key_action_top_item_get(Evas_Object *obj, const char *params EINA_UNUSED)
1496 return EINA_TRUE; 1498 return EINA_TRUE;
1497} 1499}
1498 1500
1501static Eina_Bool
1502_key_action_item_pop(Evas_Object *obj, const char *params EINA_UNUSED)
1503{
1504 Elm_Object_Item *eo_item = NULL;
1505 eo_item = elm_naviframe_top_item_get(obj);
1506 if (!eo_item) return EINA_FALSE;
1507
1508 ELM_NAVIFRAME_ITEM_DATA_GET(eo_item, it);
1509
1510 if (it->pushing || it->popping) return EINA_FALSE;
1511
1512 elm_naviframe_item_pop(obj);
1513
1514 return EINA_TRUE;
1515}
1516
1499EOLIAN static Eina_Bool 1517EOLIAN static Eina_Bool
1500_elm_naviframe_elm_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info) 1518_elm_naviframe_elm_widget_event(Eo *obj, Elm_Naviframe_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
1501{ 1519{
@@ -1999,6 +2017,7 @@ _elm_naviframe_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UN
1999{ 2017{
2000 static Elm_Atspi_Action atspi_actions[] = { 2018 static Elm_Atspi_Action atspi_actions[] = {
2001 { "top_item_get", "top_item_get", NULL, _key_action_top_item_get }, 2019 { "top_item_get", "top_item_get", NULL, _key_action_top_item_get },
2020 { "item_pop", "item_pop", NULL, _key_action_item_pop },
2002 { NULL, NULL, NULL, NULL } 2021 { NULL, NULL, NULL, NULL }
2003 }; 2022 };
2004 return &atspi_actions[0]; 2023 return &atspi_actions[0];