summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2019-03-11 21:21:22 +0000
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-13 17:02:30 +0100
commitc3f823418dc2643f352333b7feac902fe80fbdc5 (patch)
treec9fb12eaafde84d4ed22b50880104ce4f06f06c3 /src/tests
parent8ef176ca535f22944c9133d64890e0e2648a211f (diff)
ui.widget: fix theme_apply working in sub_object_add
It seems that theme_apply in sub_object_add haven't worked since commit f6fa1ef6120fdebcdaf1568674c48b9d17f76f64. scale, theme property will be set properly when the parent is changed. Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D8283
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/efl_ui_test_widget.c32
1 files changed, 32 insertions, 0 deletions
diff --git a/src/tests/elementary/efl_ui_test_widget.c b/src/tests/elementary/efl_ui_test_widget.c
index d5f9c4d525..810285d0b6 100644
--- a/src/tests/elementary/efl_ui_test_widget.c
+++ b/src/tests/elementary/efl_ui_test_widget.c
@@ -188,6 +188,37 @@ EFL_START_TEST(efl_ui_test_widget_sub_object_add_del)
188} 188}
189EFL_END_TEST 189EFL_END_TEST
190 190
191EFL_START_TEST(efl_ui_test_widget_sub_object_theme_sync)
192{
193 State s;
194 Efl_Canvas_Layout *edje;
195
196 _small_ui(&s);
197 edje = elm_widget_resize_object_get(s.btn1);
198
199 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0));
200 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 1.0));
201 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 1.0));
202
203 efl_gfx_entity_scale_set(s.win, 0.123);
204 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 0.123));
205 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123));
206 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.123));
207
208 efl_ui_widget_sub_object_del(s.box, s.btn1);
209 efl_gfx_entity_scale_set(s.win, 0.456);
210 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 1.0));
211 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.123));
212 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.456));
213
214 efl_gfx_entity_scale_set(s.win, 0.789);
215 efl_ui_widget_sub_object_add(s.box, s.btn1);
216 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn1), 0.789));
217 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(edje), 0.789));
218 ck_assert(EINA_DBL_EQ(efl_gfx_entity_scale_get(s.btn2), 0.789));
219}
220EFL_END_TEST
221
191void efl_ui_test_widget(TCase *tc) 222void efl_ui_test_widget(TCase *tc)
192{ 223{
193 tcase_add_test(tc, efl_ui_test_widget_parent_iterator); 224 tcase_add_test(tc, efl_ui_test_widget_parent_iterator);
@@ -196,4 +227,5 @@ void efl_ui_test_widget(TCase *tc)
196 tcase_add_test(tc, efl_ui_test_widget_iterator); 227 tcase_add_test(tc, efl_ui_test_widget_iterator);
197 tcase_add_test(tc, efl_ui_test_widget_sub_iterator); 228 tcase_add_test(tc, efl_ui_test_widget_sub_iterator);
198 tcase_add_test(tc, efl_ui_test_widget_sub_object_add_del); 229 tcase_add_test(tc, efl_ui_test_widget_sub_object_add_del);
230 tcase_add_test(tc, efl_ui_test_widget_sub_object_theme_sync);
199} 231}