aboutsummaryrefslogtreecommitdiff
path: root/src/comet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/comet.c')
-rw-r--r--src/comet.c18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/comet.c b/src/comet.c
index b417489..b6c40fd 100644
--- a/src/comet.c
+++ b/src/comet.c
@@ -210,16 +210,14 @@ static void menu_action(Button *btn)
button_simple_set_text(btn, g_strdup(menu_ctx->strings[to_open]), CAST(btn, ButtonSimple)->text_color);
- if (!to_open) {
- Animation *shrink = animation_group_shrink_create(MILLIS(600));
-
- if (button_set_animation((gpointer)menu_ctx->group, shrink))
- state_request_animation(menu_ctx->state);
- else
- animation_destroy(shrink);
- } else {
- state_request_redraw(menu_ctx->state, true);
- }
+ Animation *anim = to_open
+ ? animation_group_grow_create(MILLIS(600))
+ : animation_group_shrink_create(MILLIS(600));
+
+ if (button_set_animation((gpointer)menu_ctx->group, anim))
+ state_request_animation(menu_ctx->state);
+ else
+ animation_destroy(anim);
}
static void register_buttons(State *state, Color color, Color text_color, Color line_color, int line_w)