jaehyun pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=522c5250abd5200d62e84ac50ffbe8a4eb524f6c

commit 522c5250abd5200d62e84ac50ffbe8a4eb524f6c
Author: Bowon Ryu <[email protected]>
Date:   Tue Aug 21 15:31:49 2018 +0900

    efl_ui_tab_bar: implement select key bindings.
    
    Summary:
    by key bindings..
    now we can select TAB with the Return/Space key.
    
    Test Plan: elementary_test -to efl.ui.tab_pager
    
    Reviewers: Jaehyun_Cho, Hermet
    
    Reviewed By: Jaehyun_Cho
    
    Subscribers: YOhoho, cedric, #reviewers, #committers, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6779
---
 data/elementary/config/default/base.src.in  | 25 +++++++++++++++++++++-
 data/elementary/config/mobile/base.src.in   | 25 +++++++++++++++++++++-
 data/elementary/config/standard/base.src.in | 25 +++++++++++++++++++++-
 src/lib/elementary/efl_ui_tab_bar.c         | 33 +++++++++++++++++++++++++++++
 src/lib/elementary/efl_ui_tab_bar.eo        |  1 +
 src/lib/elementary/elm_priv.h               |  2 +-
 6 files changed, 107 insertions(+), 4 deletions(-)

diff --git a/data/elementary/config/default/base.src.in 
b/data/elementary/config/default/base.src.in
index e95d7faadd..b9d91e41c9 100644
--- a/data/elementary/config/default/base.src.in
+++ b/data/elementary/config/default/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131089;
+  value "config_version" int: 131090;
   value "entry_select_allow" uchar: 1;
   value "engine" string: "";
   value "vsync" uchar: 0;
@@ -2623,6 +2623,29 @@ group "Elm_Config" struct {
            }
         }
      }
+     group "Elm_Config_Bindings_Widget" struct {
+        value "name" string: "Efl.Ui.Tab_Bar";
+        group "key_bindings" list {
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Return";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "KP_Enter";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "space";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+        }
+     }
      group "Elm_Config_Bindings_Widget" struct {
         value "name" string: "Efl.Ui.Video";
         group "key_bindings" list {
diff --git a/data/elementary/config/mobile/base.src.in 
b/data/elementary/config/mobile/base.src.in
index abccea5b14..9ea71db9d0 100644
--- a/data/elementary/config/mobile/base.src.in
+++ b/data/elementary/config/mobile/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131089;
+  value "config_version" int: 131090;
   value "entry_select_allow" uchar: 1;
   value "engine" string: "";
   value "vsync" uchar: 0;
@@ -2627,6 +2627,29 @@ group "Elm_Config" struct {
            }
         }
      }
+     group "Elm_Config_Bindings_Widget" struct {
+        value "name" string: "Efl.Ui.Tab_Bar";
+        group "key_bindings" list {
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Return";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "KP_Enter";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "space";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+        }
+     }
      group "Elm_Config_Bindings_Widget" struct {
         value "name" string: "Efl.Ui.Video";
         group "key_bindings" list {
diff --git a/data/elementary/config/standard/base.src.in 
b/data/elementary/config/standard/base.src.in
index ae0de27562..538cb368ea 100644
--- a/data/elementary/config/standard/base.src.in
+++ b/data/elementary/config/standard/base.src.in
@@ -1,5 +1,5 @@
 group "Elm_Config" struct {
-  value "config_version" int: 131089;
+  value "config_version" int: 131090;
   value "entry_select_allow" uchar: 1;
   value "engine" string: "";
   value "vsync" uchar: 0;
@@ -2624,6 +2624,29 @@ group "Elm_Config" struct {
            }
         }
      }
+     group "Elm_Config_Bindings_Widget" struct {
+        value "name" string: "Efl.Ui.Tab_Bar";
+        group "key_bindings" list {
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "Return";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "KP_Enter";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+           group "Elm_Config_Binding_Key" struct {
+              value "context" int: 0;
+              value "key" string: "space";
+              value "action" string: "select";
+              value "params" string: "";
+           }
+        }
+     }
      group "Elm_Config_Bindings_Widget" struct {
         value "name" string: "Efl.Ui.Video";
         group "key_bindings" list {
diff --git a/src/lib/elementary/efl_ui_tab_bar.c 
b/src/lib/elementary/efl_ui_tab_bar.c
index f377ff2747..eb328e311b 100644
--- a/src/lib/elementary/efl_ui_tab_bar.c
+++ b/src/lib/elementary/efl_ui_tab_bar.c
@@ -10,11 +10,40 @@
 #include "els_box.h"
 
 #define MY_CLASS EFL_UI_TAB_BAR_CLASS
+#define MY_CLASS_NAME "Efl.Ui.Tab_Bar"
 
 static const char PART_NAME_TAB[] = "tab";
 
 static void _tab_select(Efl_Ui_Tab_Bar_Data *sd, Tab_Info *ti);
 
+static Eina_Bool _key_action_select(Evas_Object *obj, const char *params);
+
+static const Elm_Action key_actions[] = {
+   {"select", _key_action_select},
+   {NULL, NULL}
+};
+
+static Eina_Bool
+_key_action_select(Evas_Object *obj, const char *params EINA_UNUSED)
+{
+   EFL_UI_TAB_BAR_DATA_GET(obj, sd);
+
+   if (!sd->tab_infos) return EINA_FALSE;
+
+   Tab_Info *ti;
+   Eina_List *l, *l_next;
+   EINA_LIST_FOREACH_SAFE(sd->tab_infos, l, l_next, ti)
+     {
+        if (efl_ui_focus_object_focus_get(ti->tab))
+          {
+             _tab_select(sd, ti);
+             return EINA_TRUE;
+          }
+     }
+
+   return EINA_FALSE;
+}
+
 EOLIAN static void
 _efl_ui_tab_bar_current_tab_set(Eo *obj EINA_UNUSED, Efl_Ui_Tab_Bar_Data *sd, 
int index)
 {
@@ -364,4 +393,8 @@ _efl_ui_tab_bar_efl_object_constructor(Eo *obj, 
Efl_Ui_Tab_Bar_Data *sd)
    return obj;
 }
 
+/* Standard widget overrides */
+
+ELM_WIDGET_KEY_DOWN_DEFAULT_IMPLEMENT(efl_ui_tab_bar, Efl_Ui_Tab_Bar_Data)
+
 #include "efl_ui_tab_bar.eo.c"
diff --git a/src/lib/elementary/efl_ui_tab_bar.eo 
b/src/lib/elementary/efl_ui_tab_bar.eo
index ea07a4d051..0f1c7314f4 100644
--- a/src/lib/elementary/efl_ui_tab_bar.eo
+++ b/src/lib/elementary/efl_ui_tab_bar.eo
@@ -38,5 +38,6 @@ class Efl.Ui.Tab_Bar (Efl.Ui.Layout.Object, Efl.Ui.Clickable)
    implements {
       Efl.Object.constructor;
       Efl.Object.destructor;
+      Efl.Ui.Widget.widget_event;
    }
 }
\ No newline at end of file
diff --git a/src/lib/elementary/elm_priv.h b/src/lib/elementary/elm_priv.h
index 76d51b982b..1b78c715e0 100644
--- a/src/lib/elementary/elm_priv.h
+++ b/src/lib/elementary/elm_priv.h
@@ -159,7 +159,7 @@ struct _Elm_Theme
  * the users config doesn't need to be wiped - simply new values need
  * to be put in
  */
-# define ELM_CONFIG_FILE_GENERATION 0x0011
+# define ELM_CONFIG_FILE_GENERATION 0x0012
 # define ELM_CONFIG_VERSION_EPOCH_OFFSET 16
 # define ELM_CONFIG_VERSION         ((ELM_CONFIG_EPOCH << 
ELM_CONFIG_VERSION_EPOCH_OFFSET) | \
                                      ELM_CONFIG_FILE_GENERATION)

-- 


Reply via email to