diff options
author | Yossi Kantor <yossi.kantor@samsung.com> | 2013-02-20 12:00:49 +0200 |
---|---|---|
committer | Daniel Zaoui <daniel.zaoui@samsung.com> | 2013-05-12 15:32:33 +0300 |
commit | 3628a8c4ea2485ee7ee5a81cfd4e0f0fe62b10d6 (patch) | |
tree | b7ec3432e51f88e6b399aab4ab23d40205a039fb /src/lib/elm_list_eo.h | |
parent | e26e00d20f757ec260ded581ef00dea4cdf42e04 (diff) | |
download | elementary-3628a8c4ea2485ee7ee5a81cfd4e0f0fe62b10d6.tar.gz |
elementary: Focus improvement for elm_genlist and elm_list
Summary:
This patch applies automatic focus feature to elm_genlist and elm_list
containers.
Currently (prior to this patch), focusable widgets inside list items of both
containers receive focus by an explicit mouse click over them, and lose focus
when focus goes to someone else in the window.
This change also adds the ability to:
- focus by default on the first-from-right focusable widget upon items selection
- lose the focus when another item is selected (focused or not)
- move focus between focusable widgets inside the same item by left and right
arrow keys accordingly (up and down keys when elm_list is in horizontal mode)
Focus is supported for horizontal and vertical lists.
Tests have been added for genlists and lists to check focus feature.
Diffstat (limited to 'src/lib/elm_list_eo.h')
-rw-r--r-- | src/lib/elm_list_eo.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/elm_list_eo.h b/src/lib/elm_list_eo.h index e443ba150..91bbf76e9 100644 --- a/src/lib/elm_list_eo.h +++ b/src/lib/elm_list_eo.h @@ -32,6 +32,8 @@ ELM_OBJ_LIST_SUB_ID_FIRST_ITEM_GET, ELM_OBJ_LIST_SUB_ID_LAST_ITEM_GET, ELM_OBJ_LIST_SUB_ID_AT_XY_ITEM_GET, + ELM_OBJ_LIST_SUB_ID_FOCUS_ON_SELECTION_SET, + ELM_OBJ_LIST_SUB_ID_FOCUS_ON_SELECTION_GET, ELM_OBJ_LIST_SUB_ID_LAST }; @@ -372,5 +374,29 @@ #define elm_obj_list_at_xy_item_get(x, y, posret, ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_AT_XY_ITEM_GET), EO_TYPECHECK(Evas_Coord, x), EO_TYPECHECK(Evas_Coord, y), EO_TYPECHECK(int *, posret), EO_TYPECHECK(Elm_Object_Item **, ret) /** + * @def elm_obj_list_focus_on_selection_set + * @since 1.8 + * + * Set focus to a first from left focusable widget upon item selection. + * + * @param[in] enabled + * + * @see elm_obj_list_focus_on_selection_get + */ +#define elm_obj_list_focus_on_selection_set(enabled) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_FOCUS_ON_SELECTION_SET), EO_TYPECHECK(Eina_Bool, enabled) + +/** + * @def elm_obj_list_focus_on_selection_get + * @since 1.8 + * + * Get whether the focus will be set to a widget on an item upon it's selection. + * + * @param[out] ret + * + * @see elm_obj_list_focus_on_selection_set + */ +#define elm_obj_list_focus_on_selection_get(ret) ELM_OBJ_LIST_ID(ELM_OBJ_LIST_SUB_ID_FOCUS_ON_SELECTION_GET), EO_TYPECHECK(Eina_Bool *, ret) + +/** * @} */ |