forked from enlightenment/efl
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
This commit is contained in:
parent
f58e467cf3
commit
da16711974
|
@ -912,6 +912,14 @@ _efl_ui_layout_efl_file_mmap_get(const Eo *obj, void *_pd EINA_UNUSED)
|
|||
return efl_file_mmap_get(wd->resize_obj);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_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)
|
||||
{
|
||||
if (klass) *klass = elm_widget_theme_klass_get(obj);
|
||||
if (group) *group = elm_widget_theme_element_get(obj);
|
||||
if (style) *style = elm_widget_theme_style_get(obj);
|
||||
}
|
||||
|
||||
EOLIAN static Efl_Ui_Theme_Apply_Result
|
||||
_efl_ui_layout_base_theme_set(Eo *obj, Efl_Ui_Layout_Data *sd, const char *klass, const char *group, const char *style)
|
||||
{
|
||||
|
|
|
@ -34,12 +34,9 @@ abstract @beta Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container
|
|||
[[Whether the style was successfully applied or not, see
|
||||
the values of @Efl.Ui.Theme_Apply_Result for more information.]]
|
||||
}
|
||||
/*
|
||||
TODO:
|
||||
get {
|
||||
[[Get information about the current theme in use.]]
|
||||
}
|
||||
*/
|
||||
values {
|
||||
klass: string; [[The class of the group, eg. "button".]]
|
||||
group: string("base"); [[The group, eg. "base".]]
|
||||
|
|
|
@ -90,10 +90,27 @@ EFL_START_TEST(efl_ui_layout_test_layout_force)
|
|||
}
|
||||
EFL_END_TEST
|
||||
|
||||
EFL_START_TEST(efl_ui_layout_test_layout_theme)
|
||||
{
|
||||
Evas_Object *win;
|
||||
const char *klass, *group, *style;
|
||||
|
||||
win = win_add(NULL, "layout", EFL_UI_WIN_BASIC);
|
||||
Eo *layout = efl_add(EFL_UI_LAYOUT_CLASS, win,
|
||||
efl_ui_layout_theme_set(efl_added, "win", "background", NULL)
|
||||
);
|
||||
efl_ui_layout_theme_get(layout, &klass, &group, &style);
|
||||
ck_assert_str_eq(klass, "win");
|
||||
ck_assert_str_eq(group, "background");
|
||||
ck_assert(!style);
|
||||
}
|
||||
EFL_END_TEST
|
||||
|
||||
void efl_ui_test_layout(TCase *tc)
|
||||
{
|
||||
tcase_add_test(tc, efl_ui_layout_test_property_bind);
|
||||
tcase_add_test(tc, efl_ui_layout_test_layout_api_size_min);
|
||||
tcase_add_test(tc, efl_ui_layout_test_layout_api_update_hints);
|
||||
tcase_add_test(tc, efl_ui_layout_test_layout_force);
|
||||
tcase_add_test(tc, efl_ui_layout_test_layout_theme);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue