eunue pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=2b90e193efd4952e195a82e7fa0f72b2d7d94a3e

commit 2b90e193efd4952e195a82e7fa0f72b2d7d94a3e
Author: Jaeun Choi <jaeun12.c...@samsung.com>
Date:   Fri Dec 30 16:30:34 2016 +0900

    elm_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
---
 src/lib/elementary/elm_panel.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/lib/elementary/elm_panel.c b/src/lib/elementary/elm_panel.c
index 662d44d..ec73f94 100644
--- a/src/lib/elementary/elm_panel.c
+++ b/src/lib/elementary/elm_panel.c
@@ -520,9 +520,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;
          elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
 
@@ -532,6 +536,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;
          elm_interface_scrollable_content_pos_get(obj, NULL, &pos);
 
@@ -541,6 +547,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;
          elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
          horizontal = EINA_TRUE;
@@ -560,6 +568,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;
          elm_interface_scrollable_content_pos_get(obj, &pos, NULL);
          horizontal = EINA_TRUE;

-- 


Reply via email to