summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:36:25 -0500
committerMike Blumenkrantz <zmike@samsung.com>2019-03-04 13:36:25 -0500
commitda16711974463de030a96e020465021e8c0885d8 (patch)
tree866f741d99536328e460b039dd09303ebbb4401d /src
parentf58e467cf3ada8d6152e2782e4e0fa4eb44255c6 (diff)
efl.ui.layout: fix theme.get implementation (+unit test)
Summary: ref T7512 Reviewers: cedric Reviewed By: cedric Subscribers: cedric, #reviewers, #committers Tags: #efl_api Maniphest Tasks: T7512 Differential Revision: https://phab.enlightenment.org/D8059
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_layout.c8
-rw-r--r--src/lib/elementary/efl_ui_layout_base.eo3
-rw-r--r--src/tests/elementary/efl_ui_test_layout.c17
3 files changed, 25 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index eea91fe1ca..17260f44b2 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -912,6 +912,14 @@ _efl_ui_layout_efl_file_mmap_get(const Eo *obj, void *_pd EINA_UNUSED)
912 return efl_file_mmap_get(wd->resize_obj); 912 return efl_file_mmap_get(wd->resize_obj);
913} 913}
914 914
915EOLIAN static void
916_efl_ui_layout_base_theme_get(const Eo *obj, Efl_Ui_Layout_Data *sd EINA_UNUSED, const char **klass, const char **group, const char **style)
917{
918 if (klass) *klass = elm_widget_theme_klass_get(obj);
919 if (group) *group = elm_widget_theme_element_get(obj);
920 if (style) *style = elm_widget_theme_style_get(obj);
921}
922
915EOLIAN static Efl_Ui_Theme_Apply_Result 923EOLIAN static Efl_Ui_Theme_Apply_Result
916_efl_ui_layout_base_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style) 924_efl_ui_layout_base_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style)
917{ 925{
diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo
index 22ab3efce9..4ad9edbca5 100644
--- a/src/lib/elementary/efl_ui_layout_base.eo
+++ b/src/lib/elementary/efl_ui_layout_base.eo
@@ -34,12 +34,9 @@ abstract @beta Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container
34 [[Whether the style was successfully applied or not, see 34 [[Whether the style was successfully applied or not, see
35 the values of @Efl.Ui.Theme_Apply_Result for more information.]] 35 the values of @Efl.Ui.Theme_Apply_Result for more information.]]
36 } 36 }
37 /*
38 TODO:
39 get { 37 get {
40 [[Get information about the current theme in use.]] 38 [[Get information about the current theme in use.]]
41 } 39 }
42 */
43 values { 40 values {
44 klass: string; [[The class of the group, eg. "button".]] 41 klass: string; [[The class of the group, eg. "button".]]
45 group: string("base"); [[The group, eg. "base".]] 42 group: string("base"); [[The group, eg. "base".]]
diff --git a/src/tests/elementary/efl_ui_test_layout.c b/src/tests/elementary/efl_ui_test_layout.c
index f64c7131ce..7aac2adc54 100644
--- a/src/tests/elementary/efl_ui_test_layout.c
+++ b/src/tests/elementary/efl_ui_test_layout.c
@@ -90,10 +90,27 @@ EFL_START_TEST(efl_ui_layout_test_layout_force)
90} 90}
91EFL_END_TEST 91EFL_END_TEST
92 92
93EFL_START_TEST(efl_ui_layout_test_layout_theme)
94{
95 Evas_Object *win;
96 const char *klass, *group, *style;
97
98 win = win_add(NULL, "layout", EFL_UI_WIN_BASIC);
99 Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win,
100 efl_ui_layout_theme_set(efl_added, "win", "background", NULL)
101 );
102 efl_ui_layout_theme_get(layout, &klass, &group, &style);
103 ck_assert_str_eq(klass, "win");
104 ck_assert_str_eq(group, "background");
105 ck_assert(!style);
106}
107EFL_END_TEST
108
93void efl_ui_test_layout(TCase *tc) 109void efl_ui_test_layout(TCase *tc)
94{ 110{
95 tcase_add_test(tc, efl_ui_layout_test_property_bind); 111 tcase_add_test(tc, efl_ui_layout_test_property_bind);
96 tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min); 112 tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min);
97 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints); 113 tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints);
98 tcase_add_test(tc, efl_ui_layout_test_layout_force); 114 tcase_add_test(tc, efl_ui_layout_test_layout_force);
115 tcase_add_test(tc, efl_ui_layout_test_layout_theme);
99} 116}