Revert "Revert "focus: Fixed the animation issue related to bring_in.""

This reverts commit e4ae67535672d04eec9eb368b71c72932cc0f757.

This will be fixed in a next commit.
This commit is contained in:
Daniel Juyung Seo 2014-05-17 19:43:44 +09:00
parent e7563a179c
commit c3acc8d0db
2 changed files with 57 additions and 0 deletions

View File

@ -714,6 +714,21 @@ _focus_highlight_clip_disable_changed_cb(void *data EINA_UNUSED,
elm_config_focus_highlight_clip_disabled_set(disable);
}
static void
_focus_bring_in_changed_cb(void *data EINA_UNUSED,
Evas_Object *obj,
void *event_info EINA_UNUSED)
{
elm_config_focus_auto_scroll_bring_in_enabled_set(elm_check_state_get(obj));
}
static void
_horizontal_btn(void *data, Evas_Object *obj, void *event_info EINA_UNUSED)
{
Evas_Object *box_btn = data;
elm_box_horizontal_set(box_btn, elm_check_state_get(obj));
}
void
test_focus3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
@ -791,6 +806,21 @@ test_focus3(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_in
_focus_highlight_clip_disable_changed_cb,
NULL);
ck = elm_check_add(box);
elm_object_text_set(ck, "Focus Auto scroll bring in enable");
evas_object_size_hint_weight_set(ck, EVAS_HINT_EXPAND, 0.0);
evas_object_smart_callback_add(ck, "changed", _focus_bring_in_changed_cb,
NULL);
elm_check_state_set(ck, elm_config_focus_auto_scroll_bring_in_enabled_get());
elm_box_pack_end(box, ck);
evas_object_show(ck);
ck = elm_check_add(box);
elm_object_text_set(ck, "Horizontal Mode");
evas_object_smart_callback_add(ck, "changed", _horizontal_btn, box_btn);
elm_box_pack_end(box, ck);
evas_object_show(ck);
evas_object_show(win);
}

View File

@ -3789,8 +3789,35 @@ elm_widget_focus_highlight_focus_part_geometry_get(const Evas_Object *obj,
EOLIAN static void
_elm_widget_focus_highlight_geometry_get(Eo *obj, Elm_Widget_Smart_Data *sd, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
{
Evas_Coord ox = 0, oy = 0, ow = 0, oh = 0;
Evas_Object *scroller = obj;
evas_object_geometry_get(obj, x, y, w, h);
elm_widget_focus_highlight_focus_part_geometry_get(sd->resize_obj, x, y, w, h);
if (!_elm_config->focus_auto_scroll_bring_in_enable)
return;
while (scroller)
{
if (_elm_scrollable_is(scroller))
{
eo_do(scroller,
elm_interface_scrollable_content_viewport_geometry_get(&ox, &oy, &ow, &oh));
if (*y < oy)
*y = oy;
else if ((oy + oh) < (*y + *h))
*y = (oy + oh - *h);
else if (*x < ox)
*x = ox;
else if ((ox + ow) < (*x + *w))
*x = (ox + ow - *w);
break;
}
scroller = elm_widget_parent_get(scroller);
}
}
EOLIAN static Elm_Object_Item*