From e04fb9c0ebf32322b662ed26ca4d4dc1df90ce44 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Tue, 1 Sep 2026 13:40:24 -0400 Subject: [PATCH] Initial radial mgs for Gabbro --- src/c/main.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/c/main.c b/src/c/main.c index 945bb29..b94b867 100644 --- a/src/c/main.c +++ b/src/c/main.c @@ -149,6 +149,7 @@ static void fuel_update_proc(Layer *layer, GContext *ctx) { } } +#if PBL_RECT static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool isFuel) { GRect bounds = layer_get_bounds(layer); graphics_context_set_fill_color(ctx, settings.ColorBarsMG); @@ -168,6 +169,19 @@ static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool is const uint16_t top_color_y = bounds.origin.y + 1; graphics_draw_line(ctx, GPoint(bounds.origin.x + 1, top_color_y), GPoint(bounds.origin.x + s_bar_width, top_color_y)); } +#else +static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool isFuel) { + GRect bounds = layer_get_bounds(layer); + APP_LOG(APP_LOG_LEVEL_DEBUG, "%d,%d,%d,%d", bounds.origin.x, bounds.origin.y, bounds.size.w, bounds.size.h); + graphics_context_set_fill_color(ctx, settings.ColorBarsMG); + graphics_context_set_antialiased(ctx, false); + if (isFuel) { + graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(5)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(230), DEG_TO_TRIGANGLE(310)); + } else { + graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(5)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(50), DEG_TO_TRIGANGLE(130)); + } +} +#endif static void temp_mg_update_proc(Layer *layer, GContext *ctx) { temp_fuel_mg_update_proc_helper(layer, ctx, false); @@ -502,9 +516,14 @@ static void apply_settings() { static void main_window_load() { s_window_layer = window_get_root_layer(s_main_window); +#if PBL_RECT s_temp_mg_layer = layer_create(GRect(s_temp_guage_x_pos - 1, 21, s_bar_width + 2, PBL_DISPLAY_HEIGHT - 43)); - layer_set_update_proc(s_temp_mg_layer, temp_mg_update_proc); s_fuel_mg_layer = layer_create(GRect(s_fuel_guage_x_pos - 1, 21, s_bar_width + 2, PBL_DISPLAY_HEIGHT - 43)); +#else + s_temp_mg_layer = layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT)); + s_fuel_mg_layer = layer_create(GRect(0, 0, PBL_DISPLAY_WIDTH, PBL_DISPLAY_HEIGHT)); +#endif + layer_set_update_proc(s_temp_mg_layer, temp_mg_update_proc); layer_set_update_proc(s_fuel_mg_layer, fuel_mg_update_proc); s_c_layer = bitmap_layer_create(GRect(s_temp_guage_x_pos, PBL_DISPLAY_HEIGHT - 18, 17, 15));