forked from enlightenment/efl
elm autofocus show - fix cases where focus is inside containers
i found that the focus doesnt auto-show when focusing things inside scrollers and so on. i had to add more points to trigger auto show. this fixes that @fix
This commit is contained in:
parent
c3a93cc440
commit
be2ae5f410
|
@ -115,6 +115,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
|
||||
if (!sd->box) return EINA_FALSE;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "previous"))
|
||||
elm_widget_focus_cycle(sd->box, ELM_FOCUS_PREVIOUS);
|
||||
else if (!strcmp(dir, "next"))
|
||||
|
|
|
@ -677,6 +677,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
eo_litem = eina_list_last_data_get(sd->items);
|
||||
eo_fitem = eina_list_data_get(sd->items);
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "down"))
|
||||
{
|
||||
if ((!sd->horizontal) &&
|
||||
|
|
|
@ -72,6 +72,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
ELM_PLAYER_DATA_GET(obj, sd);
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
double current, last;
|
||||
|
|
|
@ -1419,6 +1419,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
{
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "previous"))
|
||||
elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
|
||||
else if (!strcmp(dir, "next"))
|
||||
|
|
|
@ -933,6 +933,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
ELM_CALENDAR_DATA_GET(obj, sd);
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "prior"))
|
||||
{
|
||||
if (_update_data(obj, EINA_TRUE, -1)) _populate(obj);
|
||||
|
|
|
@ -1829,11 +1829,12 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
char colorbar_s[128];
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
if (sd->focused == ELM_COLORSELECTOR_PALETTE && sd->selected)
|
||||
cl = eina_list_prev(sd->selected);
|
||||
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
|
||||
else if (sd->focused == ELM_COLORSELECTOR_COMPONENTS)
|
||||
_button_clicked_cb(sd->cb_data[sd->sel_color_type],
|
||||
sd->cb_data[sd->sel_color_type]->lbt, NULL, NULL);
|
||||
else return EINA_FALSE;
|
||||
|
|
|
@ -962,6 +962,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
Eina_List *l = NULL;
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "prev"))
|
||||
{
|
||||
l = sd->selected_item->node->prev;
|
||||
|
|
|
@ -3054,6 +3054,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
|
||||
if (sd->reorder_mode && sd->reorder.running) return EINA_TRUE;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if ((!strcmp(dir, "left") && !mirrored) ||
|
||||
(!strcmp(dir, "right") && mirrored))
|
||||
{
|
||||
|
|
|
@ -2894,6 +2894,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
elm_interface_scrollable_content_viewport_geometry_get
|
||||
(NULL, NULL, &v_w, &v_h));
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
x -= step_x;
|
||||
|
|
|
@ -474,6 +474,7 @@ static Eina_Bool _key_action_move(Evas_Object *obj, const char *params)
|
|||
elm_interface_scrollable_content_viewport_geometry_get
|
||||
(NULL, NULL, &v_w, &v_h));
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
/* TODO: fix logic for horizontal mode */
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
|
|
|
@ -402,6 +402,7 @@ void _elm_module_unload(Elm_Module *m);
|
|||
const void *_elm_module_symbol_get(Elm_Module *m,
|
||||
const char *name);
|
||||
|
||||
void _elm_widget_focus_auto_show(Evas_Object *obj);
|
||||
void _elm_widget_top_win_focused_set(Evas_Object *obj,
|
||||
Eina_Bool top_win_focused);
|
||||
Eina_Bool _elm_widget_top_win_focused_get(const Evas_Object *obj);
|
||||
|
|
|
@ -113,6 +113,8 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
(&v_x, &v_y, &v_w, &v_h));
|
||||
evas_object_geometry_get(sd->content, &c_x, &c_y, &max_x, &max_y);
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
|
||||
current_focus = elm_widget_focused_object_get(obj);
|
||||
evas_object_geometry_get(current_focus, &f_x, &f_y, &f_w, &f_h);
|
||||
can_focus_list = elm_widget_can_focus_child_list_get(obj);
|
||||
|
|
|
@ -43,6 +43,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
{
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
elm_slideshow_previous(obj);
|
||||
|
|
|
@ -912,6 +912,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
{
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
if (!_item_focused_next(obj, EINA_TRUE, ELM_FOCUS_LEFT))
|
||||
|
|
|
@ -41,6 +41,7 @@ _key_action_move(Evas_Object *obj, const char *params)
|
|||
{
|
||||
const char *dir = params;
|
||||
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "left"))
|
||||
{
|
||||
double current, last;
|
||||
|
|
|
@ -1845,6 +1845,7 @@ EOLIAN static void
|
|||
_elm_widget_focus_cycle(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED, Elm_Focus_Direction dir)
|
||||
{
|
||||
Evas_Object *target = NULL;
|
||||
|
||||
if (!_elm_widget_is(obj))
|
||||
return;
|
||||
focus_origin = dir;
|
||||
|
@ -2889,6 +2890,13 @@ _elm_widget_focus_restore(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSED)
|
|||
}
|
||||
}
|
||||
|
||||
void
|
||||
_elm_widget_focus_auto_show(Evas_Object *obj)
|
||||
{
|
||||
Evas_Object *top = elm_widget_top_get(obj);
|
||||
if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
|
||||
}
|
||||
|
||||
void
|
||||
_elm_widget_top_win_focused_set(Evas_Object *obj,
|
||||
Eina_Bool top_win_focused)
|
||||
|
|
|
@ -1507,10 +1507,8 @@ static Eina_Bool
|
|||
_key_action_move(Evas_Object *obj, const char *params)
|
||||
{
|
||||
const char *dir = params;
|
||||
Evas_Object *top;
|
||||
|
||||
top = elm_widget_top_get(obj);
|
||||
if (top && eo_isa(top, ELM_WIN_CLASS)) _elm_win_focus_auto_show(top);
|
||||
_elm_widget_focus_auto_show(obj);
|
||||
if (!strcmp(dir, "previous"))
|
||||
elm_widget_focus_cycle(obj, ELM_FOCUS_PREVIOUS);
|
||||
else if (!strcmp(dir, "next"))
|
||||
|
|
Loading…
Reference in New Issue