summaryrefslogtreecommitdiff
path: root/src/tests
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-28 17:11:40 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-07-29 16:32:05 +0200
commit44a45e3acadb61235e5230d2ff38b967b99e7a39 (patch)
tree77fdbe4e9c19d92912f816daee7f2b701fe94d6f /src/tests
parenta61cef3fb208655bb98e2bc511c2abe2b9169587 (diff)
efl_ui_item: migrate to Efl.Ui.Clickable
this adds the mixin to the item. With this commit every class inheriting from Efl.Ui.Item will automatically emit all the clickable events. Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Reviewed-by: Xavi Artigas <xavierartigas@yahoo.es> Differential Revision: https://phab.enlightenment.org/D8830
Diffstat (limited to 'src/tests')
-rw-r--r--src/tests/elementary/spec/efl_test_clickable.c15
-rw-r--r--src/tests/elementary/spec/efl_ui_spec_suite.c2
2 files changed, 15 insertions, 2 deletions
diff --git a/src/tests/elementary/spec/efl_test_clickable.c b/src/tests/elementary/spec/efl_test_clickable.c
index c6ca54883b..3068aec140 100644
--- a/src/tests/elementary/spec/efl_test_clickable.c
+++ b/src/tests/elementary/spec/efl_test_clickable.c
@@ -3,12 +3,14 @@
3#endif 3#endif
4 4
5#include <Efl_Ui.h> 5#include <Efl_Ui.h>
6#include <Elementary.h>
6#include "efl_ui_spec_suite.h" 7#include "efl_ui_spec_suite.h"
7#include "suite_helpers.h" 8#include "suite_helpers.h"
8 9#include "eo_internal.h"
10#include "elm_widget.h"
9/* spec-meta-start 11/* spec-meta-start
10 {"test-interface":"Efl.Ui.Clickable", 12 {"test-interface":"Efl.Ui.Clickable",
11 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame"] 13 "test-widgets": ["Efl.Ui.Button", "Efl.Ui.Image", "Efl.Ui.Panes", "Efl.Ui.Frame", "Efl.Ui.Item.Realized"]
12 } 14 }
13 spec-meta-end 15 spec-meta-end
14 */ 16 */
@@ -58,6 +60,15 @@ prepare_window(void)
58 pos->x = 30; 60 pos->x = 30;
59 pos->y = 10; 61 pos->y = 10;
60 } 62 }
63 else if (efl_isa(widget, EFL_UI_ITEM_CLASS))
64 {
65 elm_widget_theme_klass_set(widget, "grid_item");
66 elm_widget_theme_element_set(widget, NULL);
67 elm_widget_theme_style_set(widget, NULL);
68 efl_ui_widget_theme_apply(widget);
69 pos->x = 30;
70 pos->y = 30;
71 }
61 72
62 evas_smart_objects_calculate(evas_object_evas_get(win)); 73 evas_smart_objects_calculate(evas_object_evas_get(win));
63 evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, prepare_window_norendered, pos); 74 evas_event_callback_add(evas_object_evas_get(win), EVAS_CALLBACK_RENDER_POST, prepare_window_norendered, pos);
diff --git a/src/tests/elementary/spec/efl_ui_spec_suite.c b/src/tests/elementary/spec/efl_ui_spec_suite.c
index dc5462a89e..50b32c362e 100644
--- a/src/tests/elementary/spec/efl_ui_spec_suite.c
+++ b/src/tests/elementary/spec/efl_ui_spec_suite.c
@@ -12,6 +12,8 @@ Evas_Object *win = NULL;
12Evas_Object *widget = NULL; 12Evas_Object *widget = NULL;
13const Efl_Class *test_content_klass = NULL; 13const Efl_Class *test_content_klass = NULL;
14EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS); 14EFL_CLASS_SIMPLE_CLASS(efl_ui_widget, "efl_ui_widget", EFL_UI_WIDGET_CLASS);
15EFL_CLASS_SIMPLE_CLASS(efl_ui_item, "efl_ui_item", EFL_UI_ITEM_CLASS);
16#define EFL_UI_ITEM_REALIZED_CLASS efl_ui_item_realized_class_get()
15 17
16static void 18static void
17_setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass) 19_setup_window_and_widget(const Efl_Class *klass, const Efl_Class *content_klass)