mirror of
https://git.wetfence.xyz/RandyTheSilly/Civic-Segments.git
synced 2026-09-05 18:17:13 -04:00
Initial radial mgs for Gabbro
This commit is contained in:
+20
-1
@@ -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) {
|
static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool isFuel) {
|
||||||
GRect bounds = layer_get_bounds(layer);
|
GRect bounds = layer_get_bounds(layer);
|
||||||
graphics_context_set_fill_color(ctx, settings.ColorBarsMG);
|
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;
|
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));
|
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) {
|
static void temp_mg_update_proc(Layer *layer, GContext *ctx) {
|
||||||
temp_fuel_mg_update_proc_helper(layer, ctx, false);
|
temp_fuel_mg_update_proc_helper(layer, ctx, false);
|
||||||
@@ -502,9 +516,14 @@ static void apply_settings() {
|
|||||||
static void main_window_load() {
|
static void main_window_load() {
|
||||||
s_window_layer = window_get_root_layer(s_main_window);
|
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));
|
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));
|
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);
|
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));
|
s_c_layer = bitmap_layer_create(GRect(s_temp_guage_x_pos, PBL_DISPLAY_HEIGHT - 18, 17, 15));
|
||||||
|
|||||||
Reference in New Issue
Block a user