summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elc_ctxpopup.c
diff options
context:
space:
mode:
authorMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-09-25 18:07:54 +0200
committerMarcel Hollerbach <marcel-hollerbach@t-online.de>2017-10-10 19:28:47 +0200
commit6ba107b8996055dc94cf721de6bebc11838b56f7 (patch)
tree77bdc05ab09ebdecdbd7509bd6fbdfb00db888b8 /src/lib/elementary/elc_ctxpopup.c
parentac18f7fe0426e66b47cdc27696bda7377a96acb7 (diff)
elm: introduce efl_ui_focus_layer
what it does is described in the mixin this commit refactors inwin hover popup ctxpopup to use that behaviour. Since it should do exactly that.
Diffstat (limited to 'src/lib/elementary/elc_ctxpopup.c')
-rw-r--r--src/lib/elementary/elc_ctxpopup.c83
1 files changed, 0 insertions, 83 deletions
diff --git a/src/lib/elementary/elc_ctxpopup.c b/src/lib/elementary/elc_ctxpopup.c
index 166ef96..1799b65 100644
--- a/src/lib/elementary/elc_ctxpopup.c
+++ b/src/lib/elementary/elc_ctxpopup.c
@@ -38,11 +38,9 @@ static const Evas_Smart_Cb_Description _smart_callbacks[] = {
38}; 38};
39#undef ELM_PRIV_CTXPOPUP_SIGNALS 39#undef ELM_PRIV_CTXPOPUP_SIGNALS
40 40
41static Eina_Bool _key_action_move(Evas_Object *obj, const char *params);
42static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params); 41static Eina_Bool _key_action_escape(Evas_Object *obj, const char *params);
43 42
44static const Elm_Action key_actions[] = { 43static const Elm_Action key_actions[] = {
45 {"move", _key_action_move},
46 {"escape", _key_action_escape}, 44 {"escape", _key_action_escape},
47 {NULL, NULL} 45 {NULL, NULL}
48}; 46};
@@ -61,81 +59,6 @@ _elm_ctxpopup_efl_ui_translatable_translation_update(Eo *obj, Elm_Ctxpopup_Data
61 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS)); 59 efl_ui_translatable_translation_update(efl_super(obj, MY_CLASS));
62} 60}
63 61
64EOLIAN static Eina_Bool
65_elm_ctxpopup_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *_pd EINA_UNUSED)
66{
67 return EINA_TRUE;
68}
69
70EOLIAN static Eina_Bool
71_elm_ctxpopup_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *_pd EINA_UNUSED)
72{
73 return EINA_TRUE;
74}
75
76EOLIAN static Eina_Bool
77_elm_ctxpopup_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, Elm_Focus_Direction dir, Evas_Object **next, Elm_Object_Item **next_item)
78{
79 if (!sd)
80 return EINA_FALSE;
81
82 if (!elm_obj_widget_focus_next_get(sd->box, dir, next, next_item))
83 {
84 elm_obj_widget_focused_object_clear(sd->box);
85 elm_obj_widget_focus_next_get(sd->box, dir, next, next_item);
86 }
87
88 return EINA_TRUE;
89}
90
91EOLIAN static Eina_Bool
92_elm_ctxpopup_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Ctxpopup_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, Elm_Object_Item **direction_item, double *weight)
93{
94 Eina_Bool int_ret;
95
96 Eina_List *l = NULL;
97 void *(*list_data_get)(const Eina_List *list);
98
99 if (!sd)
100 return EINA_FALSE;
101
102 list_data_get = eina_list_data_get;
103
104 l = eina_list_append(l, sd->box);
105
106 int_ret = elm_widget_focus_list_direction_get
107 (obj, base, l, list_data_get, degree, direction, direction_item, weight);
108 eina_list_free(l);
109
110 return int_ret;
111}
112
113static Eina_Bool
114_key_action_move(Evas_Object *obj, const char *params)
115{
116 ELM_CTXPOPUP_DATA_GET(obj, sd);
117 const char *dir = params;
118
119 if (!sd->box) return EINA_FALSE;
120
121 _elm_widget_focus_auto_show(obj);
122 if (!strcmp(dir, "previous"))
123 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
124 else if (!strcmp(dir, "next"))
125 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_NEXT);
126 else if (!strcmp(dir, "left"))
127 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_LEFT);
128 else if (!strcmp(dir, "right"))
129 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_RIGHT);
130 else if (!strcmp(dir, "up"))
131 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_UP);
132 else if (!strcmp(dir, "down"))
133 elm_obj_widget_focus_cycle(sd->box, ELM_FOCUS_DOWN);
134 else return EINA_FALSE;
135
136 return EINA_TRUE;
137}
138
139static Eina_Bool 62static Eina_Bool
140_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED) 63_key_action_escape(Evas_Object *obj, const char *params EINA_UNUSED)
141{ 64{
@@ -1608,12 +1531,6 @@ _elm_ctxpopup_elm_interface_atspi_widget_action_elm_actions_get(Eo *obj EINA_UNU
1608{ 1531{
1609 static Elm_Atspi_Action atspi_actions[] = { 1532 static Elm_Atspi_Action atspi_actions[] = {
1610 { "escape", "escape", NULL, _key_action_escape}, 1533 { "escape", "escape", NULL, _key_action_escape},
1611 { "move,previous", "move", "previous", _key_action_move},
1612 { "move,next", "move", "next", _key_action_move},
1613 { "move,left", "move", "left", _key_action_move},
1614 { "move,right", "move", "right", _key_action_move},
1615 { "move,up", "move", "up", _key_action_move},
1616 { "move,down", "move", "down", _key_action_move},
1617 { NULL, NULL, NULL, NULL } 1534 { NULL, NULL, NULL, NULL }
1618 }; 1535 };
1619 return &atspi_actions[0]; 1536 return &atspi_actions[0];