Add Gabbro-specific CHEF icons
@@ -67,40 +67,28 @@
|
||||
"memoryFormat": "Smallest",
|
||||
"name": "E",
|
||||
"spaceOptimization": "storage",
|
||||
"type": "bitmap",
|
||||
"targetPlatforms": [
|
||||
"emery"
|
||||
]
|
||||
"type": "bitmap"
|
||||
},
|
||||
{
|
||||
"file": "F.png",
|
||||
"memoryFormat": "Smallest",
|
||||
"name": "F",
|
||||
"spaceOptimization": "storage",
|
||||
"type": "bitmap",
|
||||
"targetPlatforms": [
|
||||
"emery"
|
||||
]
|
||||
"type": "bitmap"
|
||||
},
|
||||
{
|
||||
"file": "C.png",
|
||||
"memoryFormat": "Smallest",
|
||||
"name": "C",
|
||||
"spaceOptimization": "storage",
|
||||
"type": "bitmap",
|
||||
"targetPlatforms": [
|
||||
"emery"
|
||||
]
|
||||
"type": "bitmap"
|
||||
},
|
||||
{
|
||||
"file": "H.png",
|
||||
"memoryFormat": "Smallest",
|
||||
"name": "H",
|
||||
"spaceOptimization": "storage",
|
||||
"type": "bitmap",
|
||||
"targetPlatforms": [
|
||||
"emery"
|
||||
]
|
||||
"type": "bitmap"
|
||||
},
|
||||
{
|
||||
"file": "0.png",
|
||||
|
||||
|
Before Width: | Height: | Size: 108 B After Width: | Height: | Size: 108 B |
|
After Width: | Height: | Size: 97 B |
|
Before Width: | Height: | Size: 112 B After Width: | Height: | Size: 112 B |
|
After Width: | Height: | Size: 103 B |
|
Before Width: | Height: | Size: 107 B After Width: | Height: | Size: 107 B |
|
After Width: | Height: | Size: 99 B |
|
Before Width: | Height: | Size: 90 B After Width: | Height: | Size: 90 B |
|
After Width: | Height: | Size: 88 B |
@@ -27,10 +27,8 @@ static const GRect s_digit_grects[4] = {GRect(s_x_l, 18, 69, 110), GRect(s_x_r,
|
||||
static ClaySettings settings;
|
||||
static GColor s_applied_digits_mg = GColorDarkGray;
|
||||
static GColor s_applied_digits_mg_mini = GColorDarkGray;
|
||||
#if PBL_RECT
|
||||
static GColor s_applied_e_f = GColorWhite;
|
||||
static GColor s_applied_c_h = GColorWhite;
|
||||
#endif
|
||||
static GColor s_applied_hour = GColorWhite;
|
||||
static GColor s_applied_minute = GColorWhite;
|
||||
static GColor s_applied_minute_mini = GColorWhite;
|
||||
@@ -41,12 +39,10 @@ static GBitmap *s_minute_bitmaps[10];
|
||||
static GBitmap *s_minute_bitmaps_mini[10];
|
||||
static GBitmap *s_digit_mg_super8;
|
||||
static GBitmap *s_digit_mg_super8_mini;
|
||||
#if PBL_RECT
|
||||
static GBitmap *s_c_icon;
|
||||
static GBitmap *s_h_icon;
|
||||
static GBitmap *s_e_icon;
|
||||
static GBitmap *s_f_icon;
|
||||
#endif
|
||||
|
||||
// tracking statics
|
||||
static bool s_peek_active = false;
|
||||
@@ -57,7 +53,7 @@ static bool s_pkjs_ready = false;
|
||||
static bool s_fuel_is_warning = false;
|
||||
static int s_batt_level;
|
||||
static bool s_temp_is_warning = false;
|
||||
static int8_t s_temp_level;
|
||||
static int8_t s_temp_level = 20;
|
||||
|
||||
// bar statics
|
||||
#if PBL_RECT
|
||||
@@ -84,7 +80,6 @@ static const uint32_t s_digit_resource_ids[10] = {RESOURCE_ID_0, RESOURCE_ID_1,
|
||||
static const uint32_t s_digit_mini_resource_ids[10] = {RESOURCE_ID_0_M, RESOURCE_ID_1_M, RESOURCE_ID_2_M, RESOURCE_ID_3_M, RESOURCE_ID_4_M,
|
||||
RESOURCE_ID_5_M, RESOURCE_ID_6_M, RESOURCE_ID_7_M, RESOURCE_ID_8_M, RESOURCE_ID_9_M};
|
||||
|
||||
#if PBL_RECT
|
||||
static void toggle_fuel_warning_state(bool enable_warning, bool force) {
|
||||
if (!force && (enable_warning == s_fuel_is_warning)) {
|
||||
return;
|
||||
@@ -100,11 +95,7 @@ static void toggle_fuel_warning_state(bool enable_warning, bool force) {
|
||||
s_applied_e_f = dst;
|
||||
s_fuel_is_warning = enable_warning;
|
||||
}
|
||||
#else
|
||||
static void toggle_fuel_warning_state(bool enable_warning, bool force) {} // TODO
|
||||
#endif
|
||||
|
||||
#if PBL_RECT
|
||||
static void toggle_temp_warning_state(bool enable_warning, bool force) {
|
||||
if (!force && (enable_warning == s_temp_is_warning)) {
|
||||
return;
|
||||
@@ -120,9 +111,6 @@ static void toggle_temp_warning_state(bool enable_warning, bool force) {
|
||||
s_applied_c_h = dst;
|
||||
s_temp_is_warning = enable_warning;
|
||||
}
|
||||
#else
|
||||
static void toggle_temp_warning_state(bool enable_warning, bool force) {} // TODO
|
||||
#endif
|
||||
|
||||
static void recolor_digit_bitmaps(GBitmap **bitmaps, GColor *applied, GColor new_color) {
|
||||
if (applied->argb == new_color.argb)
|
||||
@@ -228,17 +216,17 @@ static void temp_fuel_mg_update_proc_helper(Layer *layer, GContext *ctx, bool is
|
||||
graphics_context_set_fill_color(ctx, settings.ColorBarsMG);
|
||||
graphics_context_set_antialiased(ctx, false);
|
||||
if (isFuel) {
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_top), DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom));
|
||||
// graphics_context_set_fill_color(ctx, settings.ColorBarsCool);
|
||||
// graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset+2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_top + 1), DEG_TO_TRIGANGLE(s_bar_fuel_deg_top + 2));
|
||||
// graphics_context_set_fill_color(ctx, settings.ColorBarsHot);
|
||||
// graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset+2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom - 2), DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom - 1));
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_top - 2), DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom + 2));
|
||||
graphics_context_set_fill_color(ctx, settings.ColorBarsCool);
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset + 2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_top - 1.5), DEG_TO_TRIGANGLE(s_bar_fuel_deg_top));
|
||||
graphics_context_set_fill_color(ctx, settings.ColorBarsHot);
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset + 2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom), DEG_TO_TRIGANGLE(s_bar_fuel_deg_bottom + 1.5));
|
||||
} else {
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom), DEG_TO_TRIGANGLE(s_bar_temp_deg_top));
|
||||
// graphics_context_set_fill_color(ctx, settings.ColorBarsCool);
|
||||
// graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset+2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom + 1), DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom + 2));
|
||||
// graphics_context_set_fill_color(ctx, settings.ColorBarsHot);
|
||||
// graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset+2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_top - 2), DEG_TO_TRIGANGLE(s_bar_temp_deg_top - 1));
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset)), GOvalScaleModeFitCircle, s_bar_width + 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom - 2), DEG_TO_TRIGANGLE(s_bar_temp_deg_top + 2));
|
||||
graphics_context_set_fill_color(ctx, settings.ColorBarsCool);
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset + 2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom - 1.5), DEG_TO_TRIGANGLE(s_bar_temp_deg_bottom));
|
||||
graphics_context_set_fill_color(ctx, settings.ColorBarsHot);
|
||||
graphics_fill_radial(ctx, grect_inset(bounds, GEdgeInsets(s_bar_base_inset + 2)), GOvalScaleModeFitCircle, s_bar_width - 2, DEG_TO_TRIGANGLE(s_bar_temp_deg_top), DEG_TO_TRIGANGLE(s_bar_temp_deg_top + 1.5));
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -585,6 +573,17 @@ static void main_window_load() {
|
||||
s_h_layer = bitmap_layer_create(GRect(s_temp_guage_x_pos, 3, 17, 14));
|
||||
s_e_layer = bitmap_layer_create(GRect(s_fuel_guage_x_pos, PBL_DISPLAY_HEIGHT - 18, 17, 15));
|
||||
s_f_layer = bitmap_layer_create(GRect(s_fuel_guage_x_pos, 3, 17, 14));
|
||||
s_temp_mg_layer = layer_create(GRect(s_temp_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
|
||||
// TODO define constants for coords and dimesnions
|
||||
s_c_layer = bitmap_layer_create(GRect(s_bar_base_inset + 38, PBL_DISPLAY_HEIGHT - 48, 10, 10));
|
||||
s_h_layer = bitmap_layer_create(GRect(s_bar_base_inset + 38, 38, 10, 10));
|
||||
s_e_layer = bitmap_layer_create(GRect(PBL_DISPLAY_WIDTH - s_bar_base_inset - 48, PBL_DISPLAY_HEIGHT - 48, 10, 10));
|
||||
s_f_layer = bitmap_layer_create(GRect(PBL_DISPLAY_WIDTH - s_bar_base_inset - 48, 38, 10, 10));
|
||||
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
|
||||
bitmap_layer_set_bitmap(s_c_layer, s_c_icon);
|
||||
bitmap_layer_set_bitmap(s_h_layer, s_h_icon);
|
||||
bitmap_layer_set_bitmap(s_e_layer, s_e_icon);
|
||||
@@ -597,13 +596,6 @@ static void main_window_load() {
|
||||
layer_add_child(s_window_layer, bitmap_layer_get_layer(s_h_layer));
|
||||
layer_add_child(s_window_layer, bitmap_layer_get_layer(s_e_layer));
|
||||
layer_add_child(s_window_layer, bitmap_layer_get_layer(s_f_layer));
|
||||
|
||||
s_temp_mg_layer = layer_create(GRect(s_temp_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_add_child(s_window_layer, s_temp_mg_layer);
|
||||
@@ -630,12 +622,10 @@ static void main_window_unload() {
|
||||
accel_tap_service_unsubscribe();
|
||||
layer_destroy(s_fuel_mg_layer);
|
||||
layer_destroy(s_temp_mg_layer);
|
||||
#if PBL_RECT
|
||||
bitmap_layer_destroy(s_f_layer);
|
||||
bitmap_layer_destroy(s_e_layer);
|
||||
bitmap_layer_destroy(s_h_layer);
|
||||
bitmap_layer_destroy(s_c_layer);
|
||||
#endif
|
||||
if (s_digit_mg_super8_mini) {
|
||||
gbitmap_destroy(s_digit_mg_super8_mini);
|
||||
}
|
||||
@@ -737,12 +727,10 @@ static void init() {
|
||||
for (int i = 0; i < 10; ++i) {
|
||||
s_hour_bitmaps[i] = gbitmap_create_with_resource(s_digit_resource_ids[i]);
|
||||
}
|
||||
#if PBL_RECT
|
||||
s_c_icon = gbitmap_create_with_resource(RESOURCE_ID_C);
|
||||
s_h_icon = gbitmap_create_with_resource(RESOURCE_ID_H);
|
||||
s_e_icon = gbitmap_create_with_resource(RESOURCE_ID_E);
|
||||
s_f_icon = gbitmap_create_with_resource(RESOURCE_ID_F);
|
||||
#endif
|
||||
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
s_digit_fg_layers[i] = bitmap_layer_create(s_digit_grects[i]);
|
||||
@@ -780,12 +768,10 @@ static void deinit() {
|
||||
tick_timer_service_unsubscribe();
|
||||
layer_destroy(s_fuel_layer);
|
||||
layer_destroy(s_temp_layer);
|
||||
#if PBL_RECT
|
||||
gbitmap_destroy(s_f_icon);
|
||||
gbitmap_destroy(s_e_icon);
|
||||
gbitmap_destroy(s_h_icon);
|
||||
gbitmap_destroy(s_c_icon);
|
||||
#endif
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
bitmap_layer_destroy(s_digit_fg_layers[i]);
|
||||
}
|
||||
|
||||