From 93c4dc6893e733f563e70c315537922d55adfab2 Mon Sep 17 00:00:00 2001 From: Federico Angelilli Date: Thu, 14 Mar 2024 02:00:21 +0100 Subject: Refactor code and start adding shine animation --- src/connect.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/connect.c') diff --git a/src/connect.c b/src/connect.c index 24f6463..d5d4f12 100644 --- a/src/connect.c +++ b/src/connect.c @@ -95,7 +95,17 @@ static void button_action(State *state, const char *event, int x, int y) 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); - if (action != NULL) action(layout->btn); + + if (action != NULL) { + action(layout->btn); + + Animation *shine = animation_shine_create(state, 500 * G_TIME_SPAN_MILLISECOND); + if (button_set_animation(layout->btn, shine)) + button_start_animation(layout->btn); + else + animation_destroy(shine); + } + return; } } else { -- cgit v1.2.3