From: Jaeun Choi Date: Fri, 23 Dec 2016 13:01:44 +0000 (+0900) Subject: panel: decide whether a scrollable panel is open or not only when it has a size X-Git-Tag: submit/tizen/20170102.091821~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2957ef2aae9bb588bd6070c96e012ac9b90e6ac5;p=platform%2Fupstream%2Felementary.git panel: decide whether a scrollable panel is open or not only when it has a size in _state_sync() function, scrollable content's position is used to tell whether the panel is open or not. in case of a top panel, for example, it is considered to be open when the content's vertical position equals to zero. however, this logic has a defect in that the position is always zero if the content size is zero - not resized properly yet. it caused unwanted results. this patch added some codes to check 1. if the panel's width or height is bigger than zero 2. if the box which contains panel contents is visible (resizable) @fix Change-Id: I997332005033cbeb3a0ebd70238de8541b257726 --- diff --git a/src/lib/elm_panel.c b/src/lib/elm_panel.c index acbd48be0..beed2ceb7 100644 --- a/src/lib/elm_panel.c +++ b/src/lib/elm_panel.c @@ -518,9 +518,13 @@ _state_sync(Evas_Object *obj) Eina_Bool open = EINA_FALSE, horizontal = EINA_FALSE; evas_object_geometry_get(obj, NULL, NULL, &w, &h); + if (!evas_object_visible_get(sd->bx)) return EINA_TRUE; + switch (sd->orient) { case ELM_PANEL_ORIENT_TOP: + if (h <= 0) return EINA_TRUE; + panel_size = h * sd->content_size_ratio; eo_do(obj, elm_interface_scrollable_content_pos_get(NULL, &pos)); @@ -530,6 +534,8 @@ _state_sync(Evas_Object *obj) break; case ELM_PANEL_ORIENT_BOTTOM: + if (h <= 0) return EINA_TRUE; + panel_size = h * sd->content_size_ratio; eo_do(obj, elm_interface_scrollable_content_pos_get(NULL, &pos)); @@ -539,6 +545,8 @@ _state_sync(Evas_Object *obj) break; case ELM_PANEL_ORIENT_LEFT: + if (w <= 0) return EINA_TRUE; + panel_size = w * sd->content_size_ratio; eo_do(obj, elm_interface_scrollable_content_pos_get(&pos, NULL)); horizontal = EINA_TRUE; @@ -558,6 +566,8 @@ _state_sync(Evas_Object *obj) break; case ELM_PANEL_ORIENT_RIGHT: + if (w <= 0) return EINA_TRUE; + panel_size = w * sd->content_size_ratio; eo_do(obj, elm_interface_scrollable_content_pos_get(&pos, NULL)); horizontal = EINA_TRUE;