forked from enlightenment/efl
fileselector: Added focus cycle feature.
Summary: Previously there was no focus_direction & focus_next. These functions are added in filesector winset for currect focus movement inside the winset. Test Plan: elementary_test->"fileselector" Reviewers: raster, seoz, nirajkr, singh.amitesh Differential Revision: https://phab.enlightenment.org/D913
This commit is contained in:
parent
a6e1a0e2c8
commit
c72174031d
|
@ -529,6 +529,7 @@ test_fileselector(void *data EINA_UNUSED,
|
|||
|
||||
win = elm_win_util_standard_add("fileselector", "File Selector");
|
||||
elm_win_autodel_set(win, EINA_TRUE);
|
||||
elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
|
||||
|
||||
box = elm_box_add(win);
|
||||
elm_box_horizontal_set(box, EINA_TRUE);
|
||||
|
|
|
@ -2152,13 +2152,58 @@ _elm_fileselector_elm_interface_fileselector_sort_method_get(Eo *obj EINA_UNUSED
|
|||
EOLIAN static Eina_Bool
|
||||
_elm_fileselector_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_fileselector_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, Elm_Focus_Direction dir, Evas_Object **next)
|
||||
{
|
||||
Eina_List *items = NULL;
|
||||
|
||||
if (sd->up_button) items = eina_list_append(items, sd->up_button);
|
||||
if (sd->home_button) items = eina_list_append(items, sd->home_button);
|
||||
if (sd->files_view) items = eina_list_append(items, sd->files_view);
|
||||
if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
|
||||
if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
|
||||
if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
|
||||
if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
|
||||
|
||||
if (_elm_config->access_mode)
|
||||
return elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next);
|
||||
|
||||
if (!elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next))
|
||||
*next = (Evas_Object *)obj;
|
||||
|
||||
eina_list_free(items);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_fileselector_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED)
|
||||
{
|
||||
return EINA_FALSE;
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_elm_fileselector_elm_widget_focus_direction(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, const Evas_Object *base, double degree, Evas_Object **direction, double *weight)
|
||||
{
|
||||
Eina_List *items = NULL;
|
||||
|
||||
if (sd->up_button) items = eina_list_append(items, sd->up_button);
|
||||
if (sd->home_button) items = eina_list_append(items, sd->home_button);
|
||||
if (sd->files_view) items = eina_list_append(items, sd->files_view);
|
||||
if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
|
||||
if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
|
||||
if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
|
||||
if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
|
||||
|
||||
elm_widget_focus_list_direction_get
|
||||
(obj, base, items, eina_list_data_get, degree, direction, weight);
|
||||
|
||||
eina_list_free(items);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
|
|
|
@ -39,7 +39,9 @@ class Elm_Fileselector (Elm_Layout, Elm_Interface_Fileselector)
|
|||
Eo_Base::constructor;
|
||||
Evas_Smart::add;
|
||||
Evas_Smart::del;
|
||||
Elm_Widget::focus_next;
|
||||
Elm_Widget::focus_direction_manager_is;
|
||||
Elm_Widget::focus_direction;
|
||||
Elm_Widget::event;
|
||||
Elm_Widget::theme_apply;
|
||||
Elm_Widget::focus_next_manager_is;
|
||||
|
|
Loading…
Reference in New Issue