summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-15 17:45:56 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-05-15 18:53:57 +0200
commit122ca2fa2f9290729e10715253e45f0ad343e09a (patch)
tree7888aedcff4d13ceef97d967af892c881a6105dc
parent7c7998b3dccc27fcee10668bb05c4e8d4e28c537 (diff)
theme: add a macro file for making themes easier
CLICKABLE_SIGNAL_EMITS now can be used to setup all the events required to have automatically emission of all the clickable events Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com> Differential Revision: https://phab.enlightenment.org/D8899
-rw-r--r--data/elementary/themes/default.edc1
-rw-r--r--data/elementary/themes/edc/efl/button.edc7
-rw-r--r--data/elementary/themes/edc/efl/frame.edc10
-rw-r--r--data/elementary/themes/edc/efl/macros.edc24
-rw-r--r--data/elementary/themes/edc/efl/panes.edc40
5 files changed, 31 insertions, 51 deletions
diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc
index 0e30946..7e068d6 100644
--- a/data/elementary/themes/default.edc
+++ b/data/elementary/themes/default.edc
@@ -167,6 +167,7 @@ collections {
167#include "edc/O/icons.edc" 167#include "edc/O/icons.edc"
168 168
169// New efl ui themes 169// New efl ui themes
170#include "edc/efl/macros.edc"
170#include "edc/efl/bg.edc" 171#include "edc/efl/bg.edc"
171#include "edc/efl/button.edc" 172#include "edc/efl/button.edc"
172#include "edc/efl/calendar.edc" 173#include "edc/efl/calendar.edc"
diff --git a/data/elementary/themes/edc/efl/button.edc b/data/elementary/themes/edc/efl/button.edc
index 77201b9..4a9e2da 100644
--- a/data/elementary/themes/edc/efl/button.edc
+++ b/data/elementary/themes/edc/efl/button.edc
@@ -296,9 +296,9 @@ group { name: "efl/button";
296 } 296 }
297 } 297 }
298 programs { 298 programs {
299 EFL_UI_CLICKABLE_PART_BIND("event")
299 program { 300 program {
300 signal: "mouse,down,1"; source: "event"; 301 signal: "mouse,down,1"; source: "event";
301 action: SIGNAL_EMIT "efl,action,press" "efl";
302 after: "button_click_anim"; 302 after: "button_click_anim";
303 } 303 }
304 program { name: "button_click_anim"; 304 program { name: "button_click_anim";
@@ -310,13 +310,8 @@ group { name: "efl/button";
310 } 310 }
311 program { name: "button_unclick"; 311 program { name: "button_unclick";
312 signal: "mouse,up,1"; source: "event"; 312 signal: "mouse,up,1"; source: "event";
313 action: SIGNAL_EMIT "efl,action,unpress" "efl";
314 after: "button_unclick_anim"; 313 after: "button_unclick_anim";
315 } 314 }
316 program { name: "button_pressed_out";
317 signal: "mouse,pressed,out"; source: "event";
318 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
319 }
320 program { name: "button_unclick_anim"; 315 program { name: "button_unclick_anim";
321 script { 316 script {
322 new m = get_int(btmode); 317 new m = get_int(btmode);
diff --git a/data/elementary/themes/edc/efl/frame.edc b/data/elementary/themes/edc/efl/frame.edc
index afaaba7..d964e47 100644
--- a/data/elementary/themes/edc/efl/frame.edc
+++ b/data/elementary/themes/edc/efl/frame.edc
@@ -131,15 +131,7 @@ group { name: "efl/frame";
131 transition: DECELERATE 0.3; 131 transition: DECELERATE 0.3;
132 after: "signal"; 132 after: "signal";
133 } 133 }
134 program {signal: "mouse,down,1"; source: "event"; // for "press" smart callback 134 EFL_UI_CLICKABLE_PART_BIND("event")
135 action: SIGNAL_EMIT "efl,action,press" "efl";
136 }
137 program { signal: "mouse,up,1"; source: "event"; // for "unpress" smart callback
138 action: SIGNAL_EMIT "efl,action,unpress" "efl";
139 }
140 program { signal: "mouse,pressed,out"; source: "event";
141 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
142 }
143 program { 135 program {
144 signal: "efl,action,toggle"; source: "efl"; 136 signal: "efl,action,toggle"; source: "efl";
145 script { 137 script {
diff --git a/data/elementary/themes/edc/efl/macros.edc b/data/elementary/themes/edc/efl/macros.edc
new file mode 100644
index 0000000..4705310
--- /dev/null
+++ b/data/elementary/themes/edc/efl/macros.edc
@@ -0,0 +1,24 @@
1/**
2 * A macro for defining the programms that are needed to redirect the mouse events of a part to the implementation of Efl.Ui.Clickable.
3 *
4 * The Widget using this has to call the method bind_to_theme of Efl.Ui.Clickable_Util in order to redirect the here called signals to real events that can be used in code.
5 * The resulting events on the widget will be from the Efl.Ui.Clickable class.
6 */
7
8#define EFL_UI_CLICKABLE_PART_BIND(PART) \
9program { \
10 signal: "mouse,down,1"; source: PART; \
11 action: SIGNAL_EMIT "efl,action,press" "efl"; \
12} \
13program { \
14 signal: "mouse,down,1,*"; source: PART; \
15 action: SIGNAL_EMIT "efl,action,press" "efl"; \
16} \
17program { \
18 signal: "mouse,up,1"; source: PART; \
19 action: SIGNAL_EMIT "efl,action,unpress" "efl"; \
20} \
21program { \
22 signal: "mouse,pressed,out"; source: PART; \
23 action: SIGNAL_EMIT "efl,action,mouse_out" "efl"; \
24}
diff --git a/data/elementary/themes/edc/efl/panes.edc b/data/elementary/themes/edc/efl/panes.edc
index 6809817..5bd90ae 100644
--- a/data/elementary/themes/edc/efl/panes.edc
+++ b/data/elementary/themes/edc/efl/panes.edc
@@ -129,15 +129,7 @@ group { name: "efl/panes/vertical";
129 } 129 }
130 } 130 }
131 programs { 131 programs {
132 program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback 132 EFL_UI_CLICKABLE_PART_BIND("bar")
133 action: SIGNAL_EMIT "efl,action,press" "efl";
134 }
135 program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
136 action: SIGNAL_EMIT "efl,action,unpress" "efl";
137 }
138 program { signal: "mouse,pressed,out"; source: "bar";
139 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
140 }
141 program { // for elm_panes_fixed_set() 133 program { // for elm_panes_fixed_set()
142 signal: "efl,panes,fixed"; source: "efl"; 134 signal: "efl,panes,fixed"; source: "efl";
143 action: STATE_SET "disabled" 0.0; 135 action: STATE_SET "disabled" 0.0;
@@ -267,15 +259,7 @@ group { name: "efl/panes/horizontal";
267 } 259 }
268 } 260 }
269 programs { 261 programs {
270 program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback 262 EFL_UI_CLICKABLE_PART_BIND("bar")
271 action: SIGNAL_EMIT "efl,action,press" "efl";
272 }
273 program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
274 action: SIGNAL_EMIT "efl,action,unpress" "efl";
275 }
276 program { signal: "mouse,pressed,out"; source: "bar";
277 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
278 }
279 program { // for elm_panes_fixed_set() 263 program { // for elm_panes_fixed_set()
280 signal: "efl,panes,fixed"; source: "efl"; 264 signal: "efl,panes,fixed"; source: "efl";
281 action: STATE_SET "disabled" 0.0; 265 action: STATE_SET "disabled" 0.0;
@@ -464,15 +448,7 @@ group { name: "efl/panes/vertical:flush";
464 } 448 }
465 } 449 }
466 programs { 450 programs {
467 program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback 451 EFL_UI_CLICKABLE_PART_BIND("bar")
468 action: SIGNAL_EMIT "efl,action,press" "efl";
469 }
470 program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
471 action: SIGNAL_EMIT "efl,action,unpress" "efl";
472 }
473 program { signal: "mouse,pressed,out"; source: "bar";
474 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
475 }
476 program { // for elm_panes_fixed_set() 452 program { // for elm_panes_fixed_set()
477 signal: "efl,panes,fixed"; source: "efl"; 453 signal: "efl,panes,fixed"; source: "efl";
478 action: STATE_SET "disabled" 0.0; 454 action: STATE_SET "disabled" 0.0;
@@ -717,15 +693,7 @@ group { name: "efl/panes/horizontal:flush";
717 target: "glow2a"; 693 target: "glow2a";
718 target: "glow2b"; 694 target: "glow2b";
719 } 695 }
720 program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback 696 EFL_UI_CLICKABLE_PART_BIND("bar")
721 action: SIGNAL_EMIT "efl,action,press" "efl";
722 }
723 program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
724 action: SIGNAL_EMIT "efl,action,unpress" "efl";
725 }
726 program { signal: "mouse,pressed,out"; source: "bar";
727 action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
728 }
729 program { // for elm_panes_fixed_set() 697 program { // for elm_panes_fixed_set()
730 signal: "efl,panes,fixed"; source: "efl"; 698 signal: "efl,panes,fixed"; source: "efl";
731 action: STATE_SET "disabled" 0.0; 699 action: STATE_SET "disabled" 0.0;