efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.
Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.
ref T7865
Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7865, T7867
Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 06:21:38 -07:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
# include "elementary_config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <Efl_Ui.h>
|
|
|
|
#include "efl_ui_suite.h"
|
|
|
|
|
|
|
|
static Eo *win, *check;
|
|
|
|
|
|
|
|
static void
|
|
|
|
check_setup()
|
|
|
|
{
|
|
|
|
win = win_add();
|
|
|
|
|
|
|
|
check = efl_add(EFL_UI_CHECK_CLASS, win);
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_START_TEST(check_content)
|
|
|
|
{
|
|
|
|
Eo *t = efl_add(EFL_UI_BUTTON_CLASS, win,
|
|
|
|
efl_text_set(efl_added, "asdf")
|
|
|
|
);
|
|
|
|
efl_content_set(check, t);
|
|
|
|
ck_assert_ptr_eq(efl_content_get(check), t);
|
|
|
|
//TODO verify that signals can be emitted
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
EFL_START_TEST(check_text)
|
|
|
|
{
|
|
|
|
efl_text_set(check, "Test the Rest");
|
|
|
|
ck_assert_str_eq(efl_text_get(check), "Test the Rest");
|
|
|
|
//TODO verify that signals can be emitted
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
EFL_START_TEST(check_selection_state)
|
|
|
|
{
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_ui_selectable_selected_set(check, EINA_TRUE);
|
|
|
|
ck_assert_int_eq(efl_ui_selectable_selected_get(check), EINA_TRUE);
|
|
|
|
efl_ui_selectable_selected_set(check, EINA_TRUE);
|
|
|
|
ck_assert_int_eq(efl_ui_selectable_selected_get(check), EINA_TRUE);
|
efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.
Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.
ref T7865
Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7865, T7867
Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 06:21:38 -07:00
|
|
|
//TODO verify that signals can be emitted
|
|
|
|
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_ui_selectable_selected_set(check, EINA_FALSE);
|
|
|
|
ck_assert_int_eq(efl_ui_selectable_selected_get(check), EINA_FALSE);
|
|
|
|
efl_ui_selectable_selected_set(check, EINA_FALSE);
|
|
|
|
ck_assert_int_eq(efl_ui_selectable_selected_get(check), EINA_FALSE);
|
efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.
Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.
ref T7865
Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7865, T7867
Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 06:21:38 -07:00
|
|
|
//TODO verify that signals can be emitted
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
static void
|
|
|
|
_check(void *data, const Efl_Event *ev)
|
|
|
|
{
|
|
|
|
Eina_Bool *flag = data;
|
|
|
|
|
|
|
|
*flag = *((Eina_Bool*)ev->info);
|
|
|
|
}
|
|
|
|
|
|
|
|
EFL_START_TEST(check_selection_events)
|
|
|
|
{
|
|
|
|
Eina_Bool bool_event_info = EINA_FALSE;
|
|
|
|
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_event_callback_add(check, EFL_UI_EVENT_SELECTED_CHANGED, _check, &bool_event_info);
|
|
|
|
efl_ui_selectable_selected_set(check, EINA_TRUE);
|
efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.
Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.
ref T7865
Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7865, T7867
Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 06:21:38 -07:00
|
|
|
ck_assert_int_eq(bool_event_info, EINA_TRUE);
|
2019-08-05 10:42:02 -07:00
|
|
|
efl_ui_selectable_selected_set(check, EINA_FALSE);
|
efl_ui_check: make it undependend of nstate
Summary:
check can only display 2 states, and is only designed to do so.
Additionally, nstate inherits from button, which
brings in autorepeat, which is hileriously broken on check and cannot
really work.
Right now there is not even support in the theme for clickable. So its a
good idea to get rid of this for now IMO.
ref T7865
Reviewers: stefan_schmidt, zmike, segfaultxavi, akanad, YOhoho
Reviewed By: zmike
Subscribers: cedric, #reviewers, #committers
Tags: #efl
Maniphest Tasks: T7865, T7867
Differential Revision: https://phab.enlightenment.org/D9018
2019-06-13 06:21:38 -07:00
|
|
|
ck_assert_int_eq(bool_event_info, EINA_FALSE);
|
|
|
|
}
|
|
|
|
EFL_END_TEST
|
|
|
|
|
|
|
|
void efl_ui_test_check(TCase *tc)
|
|
|
|
{
|
|
|
|
tcase_add_checked_fixture(tc, check_setup, NULL);
|
|
|
|
tcase_add_test(tc, check_selection_state);
|
|
|
|
tcase_add_test(tc, check_text);
|
|
|
|
tcase_add_test(tc, check_content);
|
|
|
|
tcase_add_test(tc, check_selection_events);
|
|
|
|
}
|