summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJEONGHYUN YUN <jh0506.yun@samsung.com>2016-09-27 17:11:03 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-09-27 17:30:48 +0900
commit490220273111c784341d99cc178db9f01b10aafe (patch)
tree9724f67eee1b47a05c7c021498cc43d4c5004714
parentc88c74de1b0e05cc50282f88944aa15986c2b13e (diff)
downloadefl-490220273111c784341d99cc178db9f01b10aafe.tar.gz
elm_panel : Fix bug with set scrollable panel orient.
Summary: 1. Fix wrong logic of ELM_PANEL_ORIENT_RIGHT case in _state_sync. 2. Move pre calc function in anim_cb to sizing_eval function. This code have caused problem that scrollable panel is not animated during drawer open and close. 3. Maintain content size ratio when orient is changed. 4. Freeze scroller when orient is changed. This code will need to change orientation when drawer opened. Reviewers: cedric, eunue Subscribers: cedric, jpeg Differential Revision: https://phab.enlightenment.org/D4320
-rw-r--r--src/lib/elementary/elm_panel.c62
1 files changed, 40 insertions, 22 deletions
diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c
index 0568892cb0..2cbeebf291 100644
--- a/src/lib/elementary/elm_panel.c
+++ b/src/lib/elementary/elm_panel.c
@@ -62,6 +62,15 @@ _elm_panel_elm_layout_sizing_eval(Eo *obj, Elm_Panel_Data *sd)
if (sd->delete_me) return;
+ if (sd->scrollable)
+ {
+ int w, h;
+ evas_object_geometry_get(obj, NULL, NULL, &w, &h);
+
+ if (sd->hidden) _drawer_close(obj, w, h, EINA_FALSE);
+ else _drawer_open(obj, w, h, EINA_FALSE);
+ }
+
evas_object_smart_calculate(sd->bx);
edje_object_size_min_calc(wd->resize_obj, &mw, &mh);
evas_object_size_hint_min_set(obj, mw, mh);
@@ -555,7 +564,7 @@ _state_sync(Evas_Object *obj)
elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
horizontal = EINA_TRUE;
- if (!elm_widget_mirrored_get(obj))
+ if (elm_widget_mirrored_get(obj))
{
if (pos == 0) open = EINA_TRUE;
else if (pos == panel_size) open = EINA_FALSE;
@@ -1095,23 +1104,6 @@ _elm_panel_efl_canvas_group_group_move(Eo *obj, Elm_Panel_Data *sd, Evas_Coord x
evas_object_move(sd->hit_rect, x, y);
}
-// FIXME: This is definitively not an animator, but a pre calc function
-// Not sure if I can hook on smart calc or on RENDER_PRE, will be left for later
-static void
-_elm_panel_anim_cb(void *data, const Efl_Event *event EINA_UNUSED)
-{
- Evas_Object *obj = data;
- ELM_PANEL_DATA_GET(obj, sd);
- int w, h;
-
- evas_object_geometry_get(obj, NULL, NULL, &w, &h);
-
- if (sd->hidden) _drawer_close(obj, w, h, EINA_FALSE);
- else _drawer_open(obj, w, h, EINA_FALSE);
-
- efl_event_callback_stop(event->object);
-}
-
EOLIAN static void
_elm_panel_efl_canvas_group_group_resize(Eo *obj, Elm_Panel_Data *sd, Evas_Coord w, Evas_Coord h)
{
@@ -1139,7 +1131,7 @@ _elm_panel_efl_canvas_group_group_resize(Eo *obj, Elm_Panel_Data *sd, Evas_Coord
break;
}
- efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _elm_panel_anim_cb, obj);
+ elm_layout_sizing_eval(obj);
}
EOLIAN static void
@@ -1199,8 +1191,34 @@ _elm_panel_orient_set(Eo *obj, Elm_Panel_Data *sd, Elm_Panel_Orient orient)
if (sd->orient == orient) return;
sd->orient = orient;
- if (sd->scrollable) _scrollable_layout_theme_set(obj, sd);
- else _orient_set_do(obj);
+ if (sd->scrollable)
+ {
+ _scrollable_layout_theme_set(obj, sd);
+
+ if (!sd->freeze)
+ {
+ switch (sd->orient)
+ {
+ case ELM_PANEL_ORIENT_TOP:
+ case ELM_PANEL_ORIENT_BOTTOM:
+ elm_interface_scrollable_movement_block_set
+ (obj, ELM_SCROLLER_MOVEMENT_BLOCK_VERTICAL);
+ break;
+ case ELM_PANEL_ORIENT_LEFT:
+ case ELM_PANEL_ORIENT_RIGHT:
+ elm_interface_scrollable_movement_block_set
+ (obj, ELM_SCROLLER_MOVEMENT_BLOCK_HORIZONTAL);
+ break;
+ }
+
+ sd->freeze = EINA_TRUE;
+ elm_layout_signal_emit(sd->scr_ly, "elm,state,content,hidden", "elm");
+ }
+
+ elm_panel_scrollable_content_size_set(obj, sd->content_size_ratio);
+ }
+ else
+ _orient_set_do(obj);
elm_layout_sizing_eval(obj);
}
@@ -1392,7 +1410,7 @@ _elm_panel_scrollable_content_size_set(Eo *obj, Elm_Panel_Data *sd, double ratio
break;
}
- efl_event_callback_add(obj, EFL_EVENT_ANIMATOR_TICK, _elm_panel_anim_cb, obj);
+ elm_layout_sizing_eval(obj);
}
EOLIAN static Eina_Bool