summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-04-12 10:19:57 +0300
committerPaul Buetow <paul@buetow.org>2026-04-12 10:19:57 +0300
commit933b699f2df72d0462bc8c10a02d4ccc4bdb9d9a (patch)
treec832433188d8665c5dd11dcf9a33b2e26a2c7bb9 /src
parentdadd2e01bebdb9597dd7a69a1a5baf6042d7e753 (diff)
w1: enforce explicit full-window goal overlay
Diffstat (limited to 'src')
-rw-r--r--src/c/fastforge.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/c/fastforge.c b/src/c/fastforge.c
index a405e22..0525739 100644
--- a/src/c/fastforge.c
+++ b/src/c/fastforge.c
@@ -11,6 +11,7 @@ time_t target_time = 0;
static Window *s_main_window;
static Window *s_goal_window;
+static Layer *s_goal_background_layer;
static TextLayer *s_title_layer;
static TextLayer *s_timer_layer;
static TextLayer *s_detail_layer;
@@ -35,6 +36,11 @@ static VibePattern s_alarm_pattern = {
static void refresh_timer_view(void);
static void refresh_goal_window_content(void);
+static void goal_background_update_proc(Layer *layer, GContext *ctx) {
+ graphics_context_set_fill_color(ctx, GColorBlack);
+ graphics_fill_rect(ctx, layer_get_bounds(layer), 0, GCornerNone);
+}
+
static void show_goal_reached_window(void) {
if (!s_goal_window) {
return;
@@ -456,6 +462,10 @@ static void goal_window_load(Window *window) {
Layer *window_layer = window_get_root_layer(window);
GRect bounds = layer_get_bounds(window_layer);
+ s_goal_background_layer = layer_create(bounds);
+ layer_set_update_proc(s_goal_background_layer, goal_background_update_proc);
+ layer_add_child(window_layer, s_goal_background_layer);
+
s_goal_title_layer = text_layer_create(GRect(0, 20, bounds.size.w, 30));
text_layer_set_background_color(s_goal_title_layer, GColorBlack);
text_layer_set_text_color(s_goal_title_layer, GColorWhite);
@@ -493,6 +503,7 @@ static void goal_window_load(Window *window) {
static void goal_window_unload(Window *window) {
(void)window;
+ layer_destroy(s_goal_background_layer);
text_layer_destroy(s_goal_title_layer);
text_layer_destroy(s_goal_time_layer);
text_layer_destroy(s_goal_stage_layer);