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
This commit is contained in:
Marcel Hollerbach 2019-05-15 17:45:56 +02:00
parent 7c7998b3dc
commit 122ca2fa2f
5 changed files with 31 additions and 51 deletions

View File

@ -167,6 +167,7 @@ collections {
#include "edc/O/icons.edc"
// New efl ui themes
#include "edc/efl/macros.edc"
#include "edc/efl/bg.edc"
#include "edc/efl/button.edc"
#include "edc/efl/calendar.edc"

View File

@ -296,9 +296,9 @@ group { name: "efl/button";
}
}
programs {
EFL_UI_CLICKABLE_PART_BIND("event")
program {
signal: "mouse,down,1"; source: "event";
action: SIGNAL_EMIT "efl,action,press" "efl";
after: "button_click_anim";
}
program { name: "button_click_anim";
@ -310,13 +310,8 @@ group { name: "efl/button";
}
program { name: "button_unclick";
signal: "mouse,up,1"; source: "event";
action: SIGNAL_EMIT "efl,action,unpress" "efl";
after: "button_unclick_anim";
}
program { name: "button_pressed_out";
signal: "mouse,pressed,out"; source: "event";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
program { name: "button_unclick_anim";
script {
new m = get_int(btmode);

View File

@ -131,15 +131,7 @@ group { name: "efl/frame";
transition: DECELERATE 0.3;
after: "signal";
}
program {signal: "mouse,down,1"; source: "event"; // for "press" smart callback
action: SIGNAL_EMIT "efl,action,press" "efl";
}
program { signal: "mouse,up,1"; source: "event"; // for "unpress" smart callback
action: SIGNAL_EMIT "efl,action,unpress" "efl";
}
program { signal: "mouse,pressed,out"; source: "event";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
EFL_UI_CLICKABLE_PART_BIND("event")
program {
signal: "efl,action,toggle"; source: "efl";
script {

View File

@ -0,0 +1,24 @@
/**
* A macro for defining the programms that are needed to redirect the mouse events of a part to the implementation of Efl.Ui.Clickable.
*
* 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.
* The resulting events on the widget will be from the Efl.Ui.Clickable class.
*/
#define EFL_UI_CLICKABLE_PART_BIND(PART) \
program { \
signal: "mouse,down,1"; source: PART; \
action: SIGNAL_EMIT "efl,action,press" "efl"; \
} \
program { \
signal: "mouse,down,1,*"; source: PART; \
action: SIGNAL_EMIT "efl,action,press" "efl"; \
} \
program { \
signal: "mouse,up,1"; source: PART; \
action: SIGNAL_EMIT "efl,action,unpress" "efl"; \
} \
program { \
signal: "mouse,pressed,out"; source: PART; \
action: SIGNAL_EMIT "efl,action,mouse_out" "efl"; \
}

View File

@ -129,15 +129,7 @@ group { name: "efl/panes/vertical";
}
}
programs {
program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
action: SIGNAL_EMIT "efl,action,press" "efl";
}
program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
action: SIGNAL_EMIT "efl,action,unpress" "efl";
}
program { signal: "mouse,pressed,out"; source: "bar";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
EFL_UI_CLICKABLE_PART_BIND("bar")
program { // for elm_panes_fixed_set()
signal: "efl,panes,fixed"; source: "efl";
action: STATE_SET "disabled" 0.0;
@ -267,15 +259,7 @@ group { name: "efl/panes/horizontal";
}
}
programs {
program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
action: SIGNAL_EMIT "efl,action,press" "efl";
}
program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
action: SIGNAL_EMIT "efl,action,unpress" "efl";
}
program { signal: "mouse,pressed,out"; source: "bar";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
EFL_UI_CLICKABLE_PART_BIND("bar")
program { // for elm_panes_fixed_set()
signal: "efl,panes,fixed"; source: "efl";
action: STATE_SET "disabled" 0.0;
@ -464,15 +448,7 @@ group { name: "efl/panes/vertical:flush";
}
}
programs {
program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
action: SIGNAL_EMIT "efl,action,press" "efl";
}
program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
action: SIGNAL_EMIT "efl,action,unpress" "efl";
}
program { signal: "mouse,pressed,out"; source: "bar";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
EFL_UI_CLICKABLE_PART_BIND("bar")
program { // for elm_panes_fixed_set()
signal: "efl,panes,fixed"; source: "efl";
action: STATE_SET "disabled" 0.0;
@ -717,15 +693,7 @@ group { name: "efl/panes/horizontal:flush";
target: "glow2a";
target: "glow2b";
}
program {signal: "mouse,down,1"; source: "bar"; // for "press" smart callback
action: SIGNAL_EMIT "efl,action,press" "efl";
}
program { signal: "mouse,up,1"; source: "bar"; // for "unpress" smart callback
action: SIGNAL_EMIT "efl,action,unpress" "efl";
}
program { signal: "mouse,pressed,out"; source: "bar";
action: SIGNAL_EMIT "efl,action,mouse_out" "efl";
}
EFL_UI_CLICKABLE_PART_BIND("bar")
program { // for elm_panes_fixed_set()
signal: "efl,panes,fixed"; source: "efl";
action: STATE_SET "disabled" 0.0;