elementary/naviframe - implemented focus next hook
authorhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Mar 2012 09:14:14 +0000 (09:14 +0000)
committerhermet <hermet@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Mon, 12 Mar 2012 09:14:14 +0000 (09:14 +0000)
git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/elementary@69238 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/lib/elc_naviframe.c

index fc83c4f..c78ef54 100644 (file)
@@ -1059,11 +1059,28 @@ _item_new(Evas_Object *obj,
 static Eina_Bool
 _focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_Object **next)
 {
+   Eina_Bool ret;
+   Elm_Naviframe_Item *top_it;
+   Eina_List *l = NULL;
    Widget_Data *wd = elm_widget_data_get(obj);
-   if (!wd || !wd->stack) return EINA_FALSE;
-   return elm_widget_focus_next_get(VIEW(elm_naviframe_top_item_get(obj)),
-                                    dir,
-                                    next);
+   void *(*list_data_get)(const Eina_List *list);
+   if (!wd) return EINA_FALSE;
+
+   top_it = (Elm_Naviframe_Item *)elm_naviframe_top_item_get(obj);
+   if (!top_it) return EINA_FALSE;
+
+   list_data_get = eina_list_data_get;
+
+   //Forcus order: prev button, next button, contents
+   if (top_it->title_prev_btn)
+     l = eina_list_append(l, top_it->title_prev_btn);
+   if (top_it->title_next_btn)
+     l = eina_list_append(l, top_it->title_next_btn);
+   l = eina_list_append(l, VIEW(top_it));
+
+   ret = elm_widget_focus_list_next_get(obj, l, list_data_get, dir, next);
+   eina_list_free(l);
+   return ret;
 }
 
 EAPI Evas_Object *