forked from enlightenment/efl
parent
f05d05fc0e
commit
9287f01020
|
@ -332,6 +332,7 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
{
|
{
|
||||||
Eina_List *l;
|
Eina_List *l;
|
||||||
int focus_next;
|
int focus_next;
|
||||||
|
int noloop = 0;
|
||||||
|
|
||||||
focus_next = 0;
|
focus_next = 0;
|
||||||
if (!sd->focused)
|
if (!sd->focused)
|
||||||
|
@ -345,28 +346,51 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
{
|
{
|
||||||
if (forward)
|
if (forward)
|
||||||
{
|
{
|
||||||
// FIXME: sd->resize_obj acocunt for
|
if (elm_widget_can_focus_get(sd->resize_obj))
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
{
|
||||||
{
|
if ((focus_next) &&
|
||||||
if (elm_widget_can_focus_get(l->data))
|
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||||
{
|
{
|
||||||
if ((focus_next) &&
|
/* the previous focused item was unfocused - so focus
|
||||||
(!elm_widget_disabled_get(l->data)))
|
* the next one (that can be focused) */
|
||||||
{
|
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||||
/* the previous focused item was unfocused - so focus
|
else noloop = 1;
|
||||||
* the next one (that can be focused) */
|
}
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
else
|
||||||
else break;
|
{
|
||||||
}
|
if (elm_widget_focus_get(sd->resize_obj))
|
||||||
else
|
{
|
||||||
{
|
/* jump to the next focused item or focus this item */
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||||
{
|
/* it returned 0 - it got to the last item and is past it */
|
||||||
/* jump to the next focused item or focus this item */
|
focus_next = 1;
|
||||||
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
}
|
||||||
/* it returned 0 - it got to the last item and is past it */
|
}
|
||||||
focus_next = 1;
|
}
|
||||||
}
|
if (!noloop)
|
||||||
|
{
|
||||||
|
for (l = sd->subobjs; l; l = l->next)
|
||||||
|
{
|
||||||
|
if (elm_widget_can_focus_get(l->data))
|
||||||
|
{
|
||||||
|
if ((focus_next) &&
|
||||||
|
(!elm_widget_disabled_get(l->data)))
|
||||||
|
{
|
||||||
|
/* the previous focused item was unfocused - so focus
|
||||||
|
* the next one (that can be focused) */
|
||||||
|
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
||||||
|
else break;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (elm_widget_focus_get(l->data))
|
||||||
|
{
|
||||||
|
/* jump to the next focused item or focus this item */
|
||||||
|
if (elm_widget_focus_jump(l->data, forward)) return 1;
|
||||||
|
/* it returned 0 - it got to the last item and is past it */
|
||||||
|
focus_next = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -397,7 +421,29 @@ elm_widget_focus_jump(Evas_Object *obj, int forward)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// FIXME: sd->resize_obj acocunt for
|
if (!l)
|
||||||
|
{
|
||||||
|
if (elm_widget_can_focus_get(sd->resize_obj))
|
||||||
|
{
|
||||||
|
if ((focus_next) &&
|
||||||
|
(!elm_widget_disabled_get(sd->resize_obj)))
|
||||||
|
{
|
||||||
|
/* the previous focused item was unfocused - so focus
|
||||||
|
* the next one (that can be focused) */
|
||||||
|
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (elm_widget_focus_get(sd->resize_obj))
|
||||||
|
{
|
||||||
|
/* jump to the next focused item or focus this item */
|
||||||
|
if (elm_widget_focus_jump(sd->resize_obj, forward)) return 1;
|
||||||
|
/* it returned 0 - it got to the last item and is past it */
|
||||||
|
focus_next = 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -499,7 +545,6 @@ elm_widget_focused_object_clear(Evas_Object *obj)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("CLEAR %p %i\n", obj, sd->focused);
|
|
||||||
sd->focused = 0;
|
sd->focused = 0;
|
||||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||||
if (sd->focus_func) sd->focus_func(obj);
|
if (sd->focus_func) sd->focus_func(obj);
|
||||||
|
@ -510,13 +555,8 @@ _elm_widget_parent_focus(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
API_ENTRY return;
|
API_ENTRY return;
|
||||||
Evas_Object *o = elm_widget_parent_get(obj);
|
Evas_Object *o = elm_widget_parent_get(obj);
|
||||||
if (sd->focused)
|
if (sd->focused) return;
|
||||||
{
|
|
||||||
printf("STOp @ %p\n", obj);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (o) _elm_widget_parent_focus(o);
|
if (o) _elm_widget_parent_focus(o);
|
||||||
printf("DOF %p\n", obj);
|
|
||||||
sd->focused = 1;
|
sd->focused = 1;
|
||||||
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
if (sd->on_focus_func) sd->on_focus_func(sd->on_focus_data, obj);
|
||||||
if (sd->focus_func) sd->focus_func(obj);
|
if (sd->focus_func) sd->focus_func(obj);
|
||||||
|
@ -529,18 +569,15 @@ elm_widget_focus_steal(Evas_Object *obj)
|
||||||
API_ENTRY return;
|
API_ENTRY return;
|
||||||
if (sd->focused) return;
|
if (sd->focused) return;
|
||||||
if (sd->disabled) return;
|
if (sd->disabled) return;
|
||||||
printf("elm_widget_focus_steal %p...\n", obj);
|
|
||||||
parent = obj;
|
parent = obj;
|
||||||
for (;;)
|
for (;;)
|
||||||
{
|
{
|
||||||
o = elm_widget_parent_get(parent);
|
o = elm_widget_parent_get(parent);
|
||||||
if (!o) break;
|
if (!o) break;
|
||||||
sd = evas_object_smart_data_get(o);
|
sd = evas_object_smart_data_get(o);
|
||||||
printf("stop2 @ %p\n", o);
|
|
||||||
if (sd->focused) break;
|
if (sd->focused) break;
|
||||||
parent = o;
|
parent = o;
|
||||||
}
|
}
|
||||||
printf("steal clear, parent %p\n", parent);
|
|
||||||
if (!elm_widget_parent_get(parent))
|
if (!elm_widget_parent_get(parent))
|
||||||
elm_widget_focused_object_clear(parent);
|
elm_widget_focused_object_clear(parent);
|
||||||
else
|
else
|
||||||
|
@ -549,24 +586,19 @@ elm_widget_focus_steal(Evas_Object *obj)
|
||||||
parent = elm_widget_parent_get(parent);
|
parent = elm_widget_parent_get(parent);
|
||||||
sd = evas_object_smart_data_get(parent);
|
sd = evas_object_smart_data_get(parent);
|
||||||
if (elm_widget_focus_get(sd->resize_obj))
|
if (elm_widget_focus_get(sd->resize_obj))
|
||||||
{
|
elm_widget_focused_object_clear(sd->resize_obj);
|
||||||
printf("clear on sub %p\n", sd->resize_obj);
|
|
||||||
elm_widget_focused_object_clear(sd->resize_obj);
|
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
for (l = sd->subobjs; l; l = l->next)
|
for (l = sd->subobjs; l; l = l->next)
|
||||||
{
|
{
|
||||||
if (elm_widget_focus_get(l->data))
|
if (elm_widget_focus_get(l->data))
|
||||||
{
|
{
|
||||||
printf("clear on sub %p\n", l->data);
|
|
||||||
elm_widget_focused_object_clear(l->data);
|
elm_widget_focused_object_clear(l->data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
printf("focus parents %p\n", obj);
|
|
||||||
_elm_widget_parent_focus(obj);
|
_elm_widget_parent_focus(obj);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue