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
This commit is contained in:
Bowon Ryu 2018-08-21 15:31:49 +09:00 committed by Jaehyun Cho
parent 8312a99a92
commit 522c5250ab
6 changed files with 107 additions and 4 deletions

View File

@ -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 {

View File

@ -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 {

View File

@ -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 {

View File

@ -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"

View File

@ -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;
}
}

View File

@ -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)