From 1ed96b3b1dd715385dbb3ab8d42a3bc8e8b87140 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 19 Jul 2026 21:57:42 -0400 Subject: [PATCH] Fix legacy animations w/custom corner radius/floating mode --- src/c/neat_bar.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/c/neat_bar.c b/src/c/neat_bar.c index c56abae..70e2fbf 100644 --- a/src/c/neat_bar.c +++ b/src/c/neat_bar.c @@ -152,19 +152,23 @@ static void s_main_layer_update_proc(Layer *layer, GContext *ctx) { graphics_context_set_fill_color(ctx, neat_bar->background_color); graphics_fill_rect(ctx, bounds, neat_bar->corner_radius, neat_bar->x_offset > 0 ? GCornersAll : GCornersLeft); - // Legacy animation: invert the background third for any pressed button + // legacy animation: invert the background third for any pressed button if (neat_bar->animations_legacy_pressed_color) { int16_t third_height = bounds.size.h / 3; - graphics_context_set_fill_color(ctx, *neat_bar->animations_legacy_pressed_color); + uint16_t radius = neat_bar->corner_radius; + uint16_t inner_radius = radius > 0 ? radius - 1 : 0; + graphics_context_set_fill_color(ctx, *(neat_bar->animations_legacy_pressed_color)); if (neat_bar->up_pressed) { - graphics_fill_rect(ctx, GRect(1, 1, bounds.size.w - 2, third_height - 2), 0, GCornerNone); + graphics_fill_rect(ctx, GRect(1, 1, bounds.size.w - 2, third_height - 2), inner_radius, + neat_bar->x_offset > 0 ? GCornersTop : GCornerTopLeft); } if (neat_bar->select_pressed) { graphics_fill_rect(ctx, GRect(1, third_height + 1, bounds.size.w - 2, third_height - 2), 0, GCornerNone); } if (neat_bar->down_pressed) { - graphics_fill_rect(ctx, GRect(1, third_height * 2 + 1, bounds.size.w - 2, bounds.size.h - third_height * 2 - 2), 0, GCornerNone); + graphics_fill_rect(ctx, GRect(1, third_height * 2 + 1, bounds.size.w - 2, bounds.size.h - third_height * 2 - 2), inner_radius, + neat_bar->x_offset > 0 ? GCornersBottom : GCornerBottomLeft); } } }