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 <cedric@osg.samsung.com>
This commit is contained in:
Youngbok Shin 2018-05-25 10:08:21 -07:00 committed by Cedric BAIL
parent 7ef4ab6b88
commit 6e6ed72921
2 changed files with 25 additions and 0 deletions

View File

@ -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)
{

View File

@ -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);
}