Elementary toolbar: Fix flickering issue from resizing the box multiple times 99/66799/3
authorYoungbok Shin <youngb.shin@samsung.com>
Thu, 21 Apr 2016 06:22:48 +0000 (15:22 +0900)
committerJaehyun Cho <jaehyun0cho@review.tizen.org>
Wed, 27 Apr 2016 01:09:51 +0000 (18:09 -0700)
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

Change-Id: I1c948edb625bc011e0bfef1025b17a7823973a25

src/lib/elm_toolbar.c
src/lib/elm_widget_toolbar.h

index 4a08fda..c0abc90 100644 (file)
@@ -396,7 +396,8 @@ _resize_job(void *data)
    eo_do(obj, elm_interface_scrollable_content_viewport_geometry_get
          (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)
      {
@@ -1580,7 +1581,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);
index 35dfc0e..c453119 100644 (file)
@@ -46,6 +46,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;