summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-14 15:50:25 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-14 15:50:25 -0400
commitbb1388798b1afaced65484cedf385a93f6b1bb6a (patch)
treeaf2ddb81544965490df52600daf2ba7133836580
parent64923b8db15fdaa25583824123e56f3c1083ac45 (diff)
efl_ui_button: port to efl.ui.clickable
Summary: Depends on D8820 Reviewers: zmike, segfaultxavi, cedric Reviewed By: segfaultxavi Subscribers: #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8821
-rw-r--r--data/elementary/themes/edc/efl/button.edc8
-rw-r--r--src/lib/elementary/efl_ui_button.c21
2 files changed, 14 insertions, 15 deletions
diff --git a/data/elementary/themes/edc/efl/button.edc b/data/elementary/themes/edc/efl/button.edc
index 55867d7ceb..77201b9f76 100644
--- a/data/elementary/themes/edc/efl/button.edc
+++ b/data/elementary/themes/edc/efl/button.edc
@@ -313,6 +313,10 @@ group { name: "efl/button";
313 action: SIGNAL_EMIT "efl,action,unpress" "efl"; 313 action: SIGNAL_EMIT "efl,action,unpress" "efl";
314 after: "button_unclick_anim"; 314 after: "button_unclick_anim";
315 } 315 }
316 program { name: "button_pressed_out";
317 signal: "mouse,pressed,out"; source: "event";
318 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
319 }
316 program { name: "button_unclick_anim"; 320 program { name: "button_unclick_anim";
317 script { 321 script {
318 new m = get_int(btmode); 322 new m = get_int(btmode);
@@ -331,10 +335,6 @@ group { name: "efl/button";
331 in: 0.5 0.0; 335 in: 0.5 0.0;
332 target: "base"; 336 target: "base";
333 } 337 }
334 program {
335 signal: "mouse,clicked,1"; source: "event";
336 action: SIGNAL_EMIT "efl,action,click" "efl";
337 }
338 program { name: "button_text_visible"; 338 program { name: "button_text_visible";
339 signal: "efl,state,text,set"; source: "efl"; 339 signal: "efl,state,text,set"; source: "efl";
340 script { 340 script {
diff --git a/src/lib/elementary/efl_ui_button.c b/src/lib/elementary/efl_ui_button.c
index 0b40c22187..f653e949dd 100644
--- a/src/lib/elementary/efl_ui_button.c
+++ b/src/lib/elementary/efl_ui_button.c
@@ -6,6 +6,7 @@
6#define EFL_ACCESS_OBJECT_PROTECTED 6#define EFL_ACCESS_OBJECT_PROTECTED
7#define ELM_LAYOUT_PROTECTED 7#define ELM_LAYOUT_PROTECTED
8#define EFL_PART_PROTECTED 8#define EFL_PART_PROTECTED
9#define EFL_UI_CLICKABLE_PROTECTED
9 10
10#include <Elementary.h> 11#include <Elementary.h>
11#include "elm_priv.h" 12#include "elm_priv.h"
@@ -75,7 +76,10 @@ _activate(Evas_Object *obj)
75 if (elm_widget_is_legacy(obj)) 76 if (elm_widget_is_legacy(obj))
76 evas_object_smart_callback_call(obj, "clicked", NULL); 77 evas_object_smart_callback_call(obj, "clicked", NULL);
77 else 78 else
78 efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL); 79 {
80 efl_ui_clickable_press(obj, 1);
81 efl_ui_clickable_unpress(obj, 1);
82 }
79 } 83 }
80 } 84 }
81} 85}
@@ -102,7 +106,10 @@ _efl_ui_button_efl_ui_widget_on_access_activate(Eo *obj, Efl_Ui_Button_Data *_pd
102 if (elm_widget_is_legacy(obj)) 106 if (elm_widget_is_legacy(obj))
103 evas_object_smart_callback_call(obj, "clicked", NULL); 107 evas_object_smart_callback_call(obj, "clicked", NULL);
104 else 108 else
105 efl_event_callback_call(obj, EFL_UI_EVENT_CLICKED, NULL); 109 {
110 efl_ui_clickable_press(obj, 1);
111 efl_ui_clickable_unpress(obj, 1);
112 }
106 113
107 if (elm_widget_is_legacy(obj)) 114 if (elm_widget_is_legacy(obj))
108 elm_layout_signal_emit(obj, "elm,anim,activate", "elm"); 115 elm_layout_signal_emit(obj, "elm,anim,activate", "elm");
@@ -184,9 +191,6 @@ _on_pressed_signal(void *data,
184 if (elm_widget_is_legacy(data)) 191 if (elm_widget_is_legacy(data))
185 evas_object_smart_callback_call 192 evas_object_smart_callback_call
186 (data, "pressed", NULL); 193 (data, "pressed", NULL);
187 else
188 efl_event_callback_call
189 (data, EFL_UI_EVENT_PRESSED, NULL);
190 194
191} 195}
192 196
@@ -204,9 +208,6 @@ _on_unpressed_signal(void *data,
204 if (elm_widget_is_legacy(data)) 208 if (elm_widget_is_legacy(data))
205 evas_object_smart_callback_call 209 evas_object_smart_callback_call
206 (data, "unpressed", NULL); 210 (data, "unpressed", NULL);
207 else
208 efl_event_callback_call
209 (data, EFL_UI_EVENT_UNPRESSED, NULL);
210} 211}
211 212
212static char * 213static char *
@@ -253,14 +254,12 @@ _efl_ui_button_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Button_Data *_pd EINA_
253 else 254 else
254 { 255 {
255 edje_object_signal_callback_add 256 edje_object_signal_callback_add
256 (wd->resize_obj, "efl,action,click", "*",
257 _on_clicked_signal, obj);
258 edje_object_signal_callback_add
259 (wd->resize_obj, "efl,action,press", "*", 257 (wd->resize_obj, "efl,action,press", "*",
260 _on_pressed_signal, obj); 258 _on_pressed_signal, obj);
261 edje_object_signal_callback_add 259 edje_object_signal_callback_add
262 (wd->resize_obj, "efl,action,unpress", "*", 260 (wd->resize_obj, "efl,action,unpress", "*",
263 _on_unpressed_signal, obj); 261 _on_unpressed_signal, obj);
262 efl_ui_clickable_util_bind_to_theme(wd->resize_obj, obj);
264 } 263 }
265 264
266 _elm_access_object_register(obj, wd->resize_obj); 265 _elm_access_object_register(obj, wd->resize_obj);