forked from enlightenment/efl
elementary/elm_grid : Add focus_direction.
SVN revision: 71103
This commit is contained in:
parent
cd3281329b
commit
6ca169273b
|
@ -69,6 +69,44 @@ _elm_grid_smart_focus_next(const Evas_Object *obj,
|
|||
return ret;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_elm_grid_smart_focus_direction(const Evas_Object *obj,
|
||||
const Evas_Object *base,
|
||||
double degree,
|
||||
Evas_Object **direction,
|
||||
double *weight)
|
||||
{
|
||||
Eina_Bool ret;
|
||||
const Eina_List *items;
|
||||
Eina_List *(*list_free)(Eina_List *list);
|
||||
void *(*list_data_get)(const Eina_List *list);
|
||||
|
||||
ELM_GRID_DATA_GET(obj, sd);
|
||||
|
||||
/* Focus chain */
|
||||
/* TODO: Change this to use other chain */
|
||||
if ((items = elm_widget_focus_custom_chain_get(obj)))
|
||||
{
|
||||
list_data_get = eina_list_data_get;
|
||||
list_free = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
items = evas_object_grid_children_get(sd->resize_obj);
|
||||
list_data_get = eina_list_data_get;
|
||||
list_free = eina_list_free;
|
||||
|
||||
if (!items) return EINA_FALSE;
|
||||
}
|
||||
|
||||
ret = elm_widget_focus_list_direction_get(obj, base, items, list_data_get,
|
||||
degree, direction, weight);
|
||||
|
||||
if (list_free) list_free((Eina_List *)items);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void
|
||||
_mirrored_set(Evas_Object *obj, Eina_Bool rtl)
|
||||
{
|
||||
|
@ -132,6 +170,7 @@ _elm_grid_smart_set_user(Elm_Widget_Smart_Class *sc)
|
|||
|
||||
sc->theme = _elm_grid_smart_theme;
|
||||
sc->focus_next = _elm_grid_smart_focus_next;
|
||||
sc->focus_direction = _elm_grid_smart_focus_direction;
|
||||
}
|
||||
|
||||
EAPI Evas_Object *
|
||||
|
|
Loading…
Reference in New Issue