elm_panel: Fix incorrect scroller content region calculation of panel.

Summary:
Fix incorrect scroller content region calculation of panel.
It is fixed that the parent of panel content becomes scr_ly if panel is scrollable.

Test Plan:
Test Panel Scrollable in elementary_test.
1. Change panel orient as ELM_PANEL_ORIENT_RIGHT in test_panel.c.
2. Run elementary_test and test Panel Scrollable.
3. You can see the right panel drawer is hidden right after it is shown.
   (After applying this patch, this problem will be resolved.)

Reviewers: seoz, woohyun, eunue, Hermet

Reviewed By: Hermet

Differential Revision: https://phab.enlightenment.org/D2125
This commit is contained in:
Jaehyun Cho 2015-03-13 17:27:03 +09:00
parent 2ffc39659b
commit 80baf57494
1 changed files with 6 additions and 0 deletions

View File

@ -886,6 +886,8 @@ _elm_panel_elm_container_content_set(Eo *obj, Elm_Panel_Data *sd, const char *pa
{
evas_object_box_append(sd->bx, sd->content);
evas_object_show(sd->content);
if (sd->scrollable)
elm_widget_sub_object_add(sd->scr_ly, sd->content);
}
elm_layout_sizing_eval(obj);
@ -940,6 +942,8 @@ _elm_panel_elm_container_content_unset(Eo *obj, Elm_Panel_Data *sd, const char *
ret = sd->content;
evas_object_box_remove_all(sd->bx, EINA_FALSE);
if (sd->scrollable)
elm_widget_sub_object_del(sd->scr_ly, sd->content);
sd->content = NULL;
return ret;
@ -1384,6 +1388,7 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
elm_interface_scrollable_content_set(sd->scr_ly));
sd->freeze = EINA_TRUE;
elm_layout_content_set(sd->scr_ly, "elm.swallow.content", sd->bx);
if (sd->content) elm_widget_sub_object_add(sd->scr_ly, sd->content);
switch (sd->orient)
{
@ -1432,6 +1437,7 @@ _elm_panel_scrollable_set(Eo *obj, Elm_Panel_Data *sd, Eina_Bool scrollable)
elm_layout_content_unset(sd->scr_ly, "elm.swallow.content");
elm_layout_content_set(obj, "elm.swallow.content", sd->bx);
if (sd->content) elm_widget_sub_object_add(sd->bx, sd->content);
}
}