diff options
Diffstat (limited to 'mobile/widgets/button.edc')
-rw-r--r-- | mobile/widgets/button.edc | 42 |
1 files changed, 41 insertions, 1 deletions
diff --git a/mobile/widgets/button.edc b/mobile/widgets/button.edc index e705db55..aa9fdd66 100644 --- a/mobile/widgets/button.edc +++ b/mobile/widgets/button.edc @@ -24,6 +24,10 @@ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ + +#define IGNORE_FLAGS_NONE 0 +#define IGNORE_FLAGS_ON_HOLD 1 + group { "elm/button/event/default"; inherit_only: 1; parts { @@ -720,11 +724,19 @@ program_remove: "unpressed"; program_remove: "clicked"; programs { + program { "load"; + signal: "load"; + source: ""; + script { + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); + } + } program { "on_pressed"; script { if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0) && (get_int(disabled) == 0)) { stop_program(PROGRAM:"delay_unpressed_effect"); set_int(mouse_down, 1); + set_ignore_flags(PART:"event", IGNORE_FLAGS_NONE); run_program(PROGRAM:"pressed_effect"); } } @@ -735,6 +747,7 @@ script { if (get_int(mouse_down) == 1) { set_int(mouse_down, 0); + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); if (get_int(animate) == 0) { emit("elm,action,unpress", ""); run_program(PROGRAM:"unpressed_effect"); @@ -1086,11 +1099,19 @@ program_remove: "unpressed"; program_remove: "clicked"; programs { + program { "load"; + signal: "load"; + source: ""; + script { + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); + } + } program { "on_pressed"; script { if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0) && (get_int(disabled) == 0)) { stop_program(PROGRAM:"delay_unpressed_effect"); set_int(mouse_down, 1); + set_ignore_flags(PART:"event", IGNORE_FLAGS_NONE); run_program(PROGRAM:"pressed_effect"); } } @@ -1100,7 +1121,8 @@ source: "event"; script { if (get_int(mouse_down) == 1) { - set_int(mouse_down, 0); + set_int(mouse_down, 0); + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); if (get_int(animate) == 0) { emit("elm,action,unpress", ""); run_program(PROGRAM:"unpressed_effect"); @@ -1371,12 +1393,20 @@ program_remove: "unpressed"; program_remove: "clicked"; programs { + program { "load"; + signal: "load"; + source: ""; + script { + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); + } + } program { "on_pressed"; script { if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0) && (get_int(disabled) == 0)) { stop_program(PROGRAM:"delay_unpressed_effect"); set_int(mouse_down, 1); set_int(animate, 1); + set_ignore_flags(PART:"event", IGNORE_FLAGS_NONE); set_state(PART:"effect_spacer", "default", 0.0); get_circumscription_radius(PART:"effect_spacer", rel_x, rel_y); custom_state(PART:"effect_spacer", "default", 0.0); @@ -1393,6 +1423,7 @@ script { if (get_int(mouse_down) == 1) { set_int(mouse_down, 0); + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); if (get_int(disabled) == 0) { if (get_int(animate) == 0) { run_program(PROGRAM:"unpressed_effect"); @@ -2114,12 +2145,20 @@ group { "elm/button/base/"style_name; \ program_remove: "unpressed"; \ program_remove: "clicked"; \ programs { \ + program { "load"; \ + signal: "load"; \ + source: ""; \ + script { \ + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); \ + } \ + } \ program { "on_pressed"; \ script { \ if ((get_int(multi_down) == 0) && (get_int(mouse_down) == 0) && (get_int(disabled) == 0)) { \ stop_program(PROGRAM:"delay_unpressed_effect"); \ set_int(mouse_down, 1); \ set_int(animate, 1); \ + set_ignore_flags(PART:"event", IGNORE_FLAGS_NONE); \ get_circumscription_radius(PART:"base", rel_x, rel_y); \ custom_state(PART:"effect_spacer", "default", 0.0); \ set_state(PART:"effect_spacer", "custom",0.0); \ @@ -2135,6 +2174,7 @@ group { "elm/button/base/"style_name; \ script { \ if (get_int(mouse_down) == 1) { \ set_int(mouse_down, 0); \ + set_ignore_flags(PART:"event", IGNORE_FLAGS_ON_HOLD); \ if (get_int(disabled) == 0) { \ if (get_int(animate) == 0) { \ run_program(PROGRAM:"unpressed_effect"); \ |