aboutsummaryrefslogtreecommitdiff
path: root/src/connect.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2024-03-15 00:21:01 +0100
committerFederico Angelilli <code@fedang.net>2024-03-15 00:21:18 +0100
commit430def6e39315b6cee807aba3e4126134b93b164 (patch)
treee400668cb1890c1f338655bd57994dbdbc8ab7cc /src/connect.c
parent5765bea99e1d497063ab312d879390b0dd3d2efd (diff)
Fix layout animation and animation handler
Diffstat (limited to 'src/connect.c')
-rw-r--r--src/connect.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/connect.c b/src/connect.c
index 71552da..f6c439b 100644
--- a/src/connect.c
+++ b/src/connect.c
@@ -93,20 +93,24 @@ static void button_action(State *state, const char *event, int x, int y)
layout->x, layout->y, layout->width, layout->height);
if (in_capsule(x, y, layout->x, layout->y, layout->width, layout->height)) {
- log_debug("Triggering action for button");
- ButtonAction action = button_simple_get_action(layout->btn);
+ Button *btn = layout->btn;
+ ButtonAction action = button_simple_get_action(btn);
+
+ // TODO: Button labels
+ log_debug("Triggering action for button [button=%p]", btn);
if (action != NULL) {
- Animation *shine = animation_shine_create(300 * G_TIME_SPAN_MILLISECOND);
+ // NOTE: Animations may change layout!
+ //Animation *anim = animation_shine_create(300 * G_TIME_SPAN_MILLISECOND);
+ Animation *anim = animation_pulse_create(1000 * G_TIME_SPAN_MILLISECOND);
- if (button_set_animation(layout->btn, shine))
+ if (button_set_animation(btn, anim))
state_request_animation(state);
else
- animation_destroy(shine);
+ animation_destroy(anim);
- action(layout->btn);
+ action(btn);
}
-
return;
}
} else {