jaehwan pushed a commit to branch master.

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

commit c0fa31d6f4f06c90a8225e1ea5d43703b7f71837
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Mon Apr 25 19:38:03 2016 +0900

    Elementary toolbar: Fix flickering issue from resizing the box multiple 
times
    
    Summary:
    The toolbar's box was resized in _sizing_eval(), _resize_job().
    In _sizing_eval(), the box was resized according to its minimum size.
    And in _resize_job(), toolbar would recalculate it and resize the box again.
    If _sizing_eval() was called after resizing the box properly from 
_resize_job(),
    the box was shrank before calling the next job.
    If the box's minimum size is needed for calculation in the job callback,
    it shouldn't change box's size before the job callback.
    @fix
    
    Test Plan: N/A
    
    Reviewers: jaehwan, eagleeye, woohyun, cedric
    
    Subscribers: jpeg
    
    Differential Revision: https://phab.enlightenment.org/D3911
---
 src/lib/elementary/elm_toolbar.c        | 8 ++++++--
 src/lib/elementary/elm_widget_toolbar.h | 1 +
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/elementary/elm_toolbar.c b/src/lib/elementary/elm_toolbar.c
index 6c1662f..039a7e4 100644
--- a/src/lib/elementary/elm_toolbar.c
+++ b/src/lib/elementary/elm_toolbar.c
@@ -370,7 +370,8 @@ _resize_job(void *data)
    elm_interface_scrollable_content_viewport_geometry_get
          (obj, NULL, NULL, &vw, &vh);
    evas_object_size_hint_min_get(sd->bx, &mw, &mh);
-   evas_object_geometry_get(sd->bx, NULL, NULL, &w, &h);
+   w = sd->minw_bx;
+   h = sd->minh_bx;
 
    if (sd->shrink_mode == ELM_TOOLBAR_SHRINK_MENU)
      {
@@ -1536,7 +1537,10 @@ _sizing_eval(Evas_Object *obj)
           minh_bx = vh;
      }
 
-   evas_object_resize(sd->bx, minw_bx, minh_bx);
+   /* Keep the box's minimum size for a moment.
+      It will be used for resizing the box in _resize_job() function. */
+   sd->minw_bx = minw_bx;
+   sd->minh_bx = minh_bx;
    evas_object_resize(sd->more, minw_bx, minh_bx);
    evas_object_size_hint_min_set(obj, minw, minh);
    evas_object_size_hint_max_set(obj, -1, -1);
diff --git a/src/lib/elementary/elm_widget_toolbar.h 
b/src/lib/elementary/elm_widget_toolbar.h
index 51be616..bdb199b 100644
--- a/src/lib/elementary/elm_widget_toolbar.h
+++ b/src/lib/elementary/elm_widget_toolbar.h
@@ -43,6 +43,7 @@ struct _Elm_Toolbar_Data
    int                                   theme_icon_size, priv_icon_size,
                                          icon_size;
    int                                   standard_priority;
+   int                                   minw_bx, minh_bx;
    unsigned int                          item_count;
    unsigned int                          separator_count;
    double                                align;

-- 


Reply via email to