diff --git a/data/elementary/themes/default.edc b/data/elementary/themes/default.edc index 0e30946e59..7e068d6dd9 100644 --- a/data/elementary/themes/default.edc +++ b/data/elementary/themes/default.edc @@ -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" diff --git a/data/elementary/themes/edc/efl/button.edc b/data/elementary/themes/edc/efl/button.edc index 77201b9f76..4a9e2dae82 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"; } } 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); diff --git a/data/elementary/themes/edc/efl/frame.edc b/data/elementary/themes/edc/efl/frame.edc index afaaba74c7..d964e47502 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"; 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 { diff --git a/data/elementary/themes/edc/efl/macros.edc b/data/elementary/themes/edc/efl/macros.edc new file mode 100644 index 0000000000..4705310ea3 --- /dev/null +++ b/data/elementary/themes/edc/efl/macros.edc @@ -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"; \ +} diff --git a/data/elementary/themes/edc/efl/panes.edc b/data/elementary/themes/edc/efl/panes.edc index 6809817d73..5bd90aed7d 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"; } } 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;