cedric pushed a commit to branch master.

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

commit 6e6ed72921aa1fb114115e2202f92126ea04b25b
Author: Youngbok Shin <youngb.s...@samsung.com>
Date:   Fri May 25 10:08:21 2018 -0700

    elementary widget: Do super's efl_gfx_color_set to apply color to widget 
itself
    
    Summary:
    The efl_gfx_color interface was not applied properly.
    The implementation code of evas_object_smart_color_set was moved
    to efl_gfx_color_set implementation code. But, these two functions are not 
same.
    In efl_gfx_color_set impl, it has to call super's color set to apply
    the given color values to widget object itself.
    
    This bug caused color_set/get test failure and the following bug.
    1. elm_image_add
    2. evas_object_color_set
    3. elm_image_file_set
    4. show. See the given color is not applied. It was applied in the past.
    
    Test Plan: color_set/get to elm_image object is included in test suite.
    
    Reviewers: raster, cedric, herdsman, woohyun
    
    Reviewed By: cedric
    
    Subscribers: #committers, zmike
    
    Tags: #efl
    
    Differential Revision: https://phab.enlightenment.org/D6163
    
    Reviewed-by: Cedric BAIL <ced...@osg.samsung.com>
---
 src/lib/elementary/efl_ui_widget.c    |  2 ++
 src/tests/elementary/elm_test_image.c | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/src/lib/elementary/efl_ui_widget.c 
b/src/lib/elementary/efl_ui_widget.c
index 0f7b19f546..6140f40baa 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -997,6 +997,8 @@ _efl_ui_widget_efl_gfx_color_color_set(Eo *obj, 
Elm_Widget_Smart_Data *pd, int r
    if (_evas_object_intercept_call(obj, EVAS_OBJECT_INTERCEPT_CB_COLOR_SET, 0, 
r, g, b, a))
      return;
 
+   efl_gfx_color_set(efl_super(obj, MY_CLASS), r, g, b, a);
+
    it = evas_object_smart_iterator_new(obj);
    EINA_ITERATOR_FOREACH(it, o)
      {
diff --git a/src/tests/elementary/elm_test_image.c 
b/src/tests/elementary/elm_test_image.c
index 5fc727e303..109c56d122 100644
--- a/src/tests/elementary/elm_test_image.c
+++ b/src/tests/elementary/elm_test_image.c
@@ -195,6 +195,28 @@ EFL_START_TEST (elm_image_async_mmap)
 }
 EFL_END_TEST
 
+EFL_START_TEST (elm_image_evas_object_color_set)
+{
+   Evas_Object *win, *image;
+   Eina_Bool ok;
+   Test_Data td;
+   Eina_File *f;
+   char path[PATH_MAX];
+   int r = 128, g = 99, b = 3, a = 230;
+   int rr = 0, gg = 0, bb = 0, aa = 0;
+
+   win = win_add(NULL, "image", ELM_WIN_BASIC);
+
+   image = elm_image_add(win);
+   evas_object_color_set(image, r, g, b, a);
+   evas_object_color_get(image, &rr, &gg, &bb, &aa);
+   ck_assert(r == rr);
+   ck_assert(g == gg);
+   ck_assert(b == bb);
+   ck_assert(a == aa);
+}
+EFL_END_TEST
+
 EFL_START_TEST (efl_ui_image_icon)
 {
    Evas_Object *win, *image;
@@ -225,5 +247,6 @@ void elm_test_image(TCase *tc)
    tcase_add_test(tc, elm_atspi_role_get);
    tcase_add_test(tc, elm_image_async_path);
    tcase_add_test(tc, elm_image_async_mmap);
+   tcase_add_test(tc, elm_image_evas_object_color_set);
    tcase_add_test(tc, efl_ui_image_icon);
 }

-- 


Reply via email to