diff options
| author | Federico Angelilli <code@fedang.net> | 2024-03-14 02:00:21 +0100 |
|---|---|---|
| committer | Federico Angelilli <code@fedang.net> | 2024-03-14 02:00:21 +0100 |
| commit | 93c4dc6893e733f563e70c315537922d55adfab2 (patch) | |
| tree | 245e84a64fed1dd56cc9e91b4fa415384caf9322 /src/connect.c | |
| parent | 398fdbaa5c02bbd138c59004053d2e8ad0082ead (diff) | |
Refactor code and start adding shine animation
Diffstat (limited to 'src/connect.c')
| -rw-r--r-- | src/connect.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 { |
