summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnil Kumar Nahak <ak.nahak@samsung.com>2014-05-29 11:35:46 +0900
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2014-05-29 11:35:46 +0900
commit1d38e0b97fee7ae2b3851766ab77d475e2e44284 (patch)
treefa95333fdd4c44299288cf3548da85124d3f6b77
parentc0d93aa4bfbed577493a9ff4d7de3c6586d9bc2c (diff)
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
-rw-r--r--src/bin/test_fileselector.c1
-rw-r--r--src/lib/elc_fileselector.c49
-rw-r--r--src/lib/elc_fileselector.eo2
3 files changed, 50 insertions, 2 deletions
diff --git a/src/bin/test_fileselector.c b/src/bin/test_fileselector.c
index a410e92f6..b32cd87bd 100644
--- a/src/bin/test_fileselector.c
+++ b/src/bin/test_fileselector.c
@@ -529,6 +529,7 @@ test_fileselector(void *data EINA_UNUSED,
529 529
530 win = elm_win_util_standard_add("fileselector", "File Selector"); 530 win = elm_win_util_standard_add("fileselector", "File Selector");
531 elm_win_autodel_set(win, EINA_TRUE); 531 elm_win_autodel_set(win, EINA_TRUE);
532 elm_win_focus_highlight_enabled_set(win, EINA_TRUE);
532 533
533 box = elm_box_add(win); 534 box = elm_box_add(win);
534 elm_box_horizontal_set(box, EINA_TRUE); 535 elm_box_horizontal_set(box, EINA_TRUE);
diff --git a/src/lib/elc_fileselector.c b/src/lib/elc_fileselector.c
index 686369d76..584e7b9ea 100644
--- a/src/lib/elc_fileselector.c
+++ b/src/lib/elc_fileselector.c
@@ -2152,13 +2152,58 @@ _elm_fileselector_elm_interface_fileselector_sort_method_get(Eo *obj EINA_UNUSED
2152EOLIAN static Eina_Bool 2152EOLIAN static Eina_Bool
2153_elm_fileselector_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED) 2153_elm_fileselector_elm_widget_focus_next_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED)
2154{ 2154{
2155 return EINA_FALSE; 2155 return EINA_TRUE;
2156}
2157
2158EOLIAN static Eina_Bool
2159_elm_fileselector_elm_widget_focus_next(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd, Elm_Focus_Direction dir, Evas_Object **next)
2160{
2161 Eina_List *items = NULL;
2162
2163 if (sd->up_button) items = eina_list_append(items, sd->up_button);
2164 if (sd->home_button) items = eina_list_append(items, sd->home_button);
2165 if (sd->files_view) items = eina_list_append(items, sd->files_view);
2166 if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
2167 if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
2168 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
2169 if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
2170
2171 if (_elm_config->access_mode)
2172 return elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next);
2173
2174 if (!elm_widget_focus_list_next_get(obj, items, eina_list_data_get, dir, next))
2175 *next = (Evas_Object *)obj;
2176
2177 eina_list_free(items);
2178
2179 return EINA_TRUE;
2156} 2180}
2157 2181
2158EOLIAN static Eina_Bool 2182EOLIAN static Eina_Bool
2159_elm_fileselector_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED) 2183_elm_fileselector_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, Elm_Fileselector_Data *sd EINA_UNUSED)
2160{ 2184{
2161 return EINA_FALSE; 2185 return EINA_TRUE;
2186}
2187
2188EOLIAN static Eina_Bool
2189_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)
2190{
2191 Eina_List *items = NULL;
2192
2193 if (sd->up_button) items = eina_list_append(items, sd->up_button);
2194 if (sd->home_button) items = eina_list_append(items, sd->home_button);
2195 if (sd->files_view) items = eina_list_append(items, sd->files_view);
2196 if (sd->path_entry) items = eina_list_append(items, sd->path_entry);
2197 if (sd->name_entry) items = eina_list_append(items, sd->name_entry);
2198 if (sd->cancel_button) items = eina_list_append(items, sd->cancel_button);
2199 if (sd->ok_button) items = eina_list_append(items, sd->ok_button);
2200
2201 elm_widget_focus_list_direction_get
2202 (obj, base, items, eina_list_data_get, degree, direction, weight);
2203
2204 eina_list_free(items);
2205
2206 return EINA_TRUE;
2162} 2207}
2163 2208
2164EOLIAN static Eina_Bool 2209EOLIAN static Eina_Bool
diff --git a/src/lib/elc_fileselector.eo b/src/lib/elc_fileselector.eo
index 65878a312..656089ea8 100644
--- a/src/lib/elc_fileselector.eo
+++ b/src/lib/elc_fileselector.eo
@@ -39,7 +39,9 @@ class Elm_Fileselector (Elm_Layout, Elm_Interface_Fileselector)
39 Eo_Base::constructor; 39 Eo_Base::constructor;
40 Evas_Smart::add; 40 Evas_Smart::add;
41 Evas_Smart::del; 41 Evas_Smart::del;
42 Elm_Widget::focus_next;
42 Elm_Widget::focus_direction_manager_is; 43 Elm_Widget::focus_direction_manager_is;
44 Elm_Widget::focus_direction;
43 Elm_Widget::event; 45 Elm_Widget::event;
44 Elm_Widget::theme_apply; 46 Elm_Widget::theme_apply;
45 Elm_Widget::focus_next_manager_is; 47 Elm_Widget::focus_next_manager_is;