_elm_panel_focus_cycle_hook(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool circular)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *cur;
if ((!wd) || (!wd->content))
return EINA_FALSE;
if (wd->hidden)
return EINA_FALSE;
+ cur = wd->content;
+
/* Try Focus cycle in subitem */
- if (elm_widget_focus_cycle(wd->content, dir, circular))
+ if (elm_widget_focus_cycle(cur, dir, circular))
return EINA_TRUE;
+ /* Ignore focused subitem */
+ if (elm_widget_focus_get(cur) && (!circular))
+ return EINA_FALSE;
/* Try give the focus to sub item*/
- else if (elm_widget_can_focus_get(wd->content) &&
- ((!elm_widget_focus_get(wd->content)) || circular))
+ if (elm_widget_can_focus_get(cur))
{
- elm_widget_focus_steal(wd->content);
+ elm_widget_focus_steal(cur);
return EINA_TRUE;
}
_elm_scroller_focus_cycle_hook(Evas_Object *obj, Elm_Focus_Direction dir, Eina_Bool circular)
{
Widget_Data *wd = elm_widget_data_get(obj);
+ Evas_Object *cur;
+
if ((!wd) || (!wd->content))
return EINA_FALSE;
+ cur = wd->content;
+
/* Try Focus cycle in subitem */
- if (elm_widget_focus_cycle(wd->content, dir, circular))
+ if (elm_widget_focus_cycle(cur, dir, circular))
return EINA_TRUE;
+ /* Ignore focused subitem */
+ if (elm_widget_focus_get(cur) && (!circular))
+ return EINA_FALSE;
/* Try give the focus to sub item*/
- else if (elm_widget_can_focus_get(wd->content) &&
- ((!elm_widget_focus_get(wd->content)) || circular))
+ if (elm_widget_can_focus_get(cur))
{
- elm_widget_focus_steal(wd->content);
+ elm_widget_focus_steal(cur);
return EINA_TRUE;
}
for (;l; l = list_next(l))
{
cur = list_data_get(l);
+
/* Try Focus cycle in subitem */
if (elm_widget_focus_cycle(cur, dir, child_circular))
break;
+ /* Ignore focused subitem */
+ if (elm_widget_focus_get(cur) && (!child_circular))
+ continue;
/* Try give the focus to sub item*/
- else if (elm_widget_can_focus_get(cur) &&
- ((!elm_widget_focus_get(cur)) || child_circular))
+ if (elm_widget_can_focus_get(cur))
{
elm_widget_focus_steal(cur);
break;