Skip to content

Commit 1bd1529

Browse files
aveaoclaude
andcommitted
health: drop typical pill lower on taller displays
Push the typical-text pill down by a third of HEALTH_Y_OFFSET, and shift the current-step count by half that, so the gap between them stays balanced. Applies to both the activity and sleep summary cards. Zero on legacy-sized displays (asterix, flint) since HEALTH_Y_OFFSET is 0 there; a few px on the taller displays (obelix, getafix) where there's slack below the pill. Regenerates activity, sleep, and card-view goldens on obelix/gabbro. Co-authored-by: Claude <noreply@anthropic.com> Signed-off-by: Ave Özkal <git@ave.zone>
1 parent e093a45 commit 1bd1529

46 files changed

Lines changed: 20 additions & 6 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/fw/apps/system/health/activity_summary_card.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,11 @@ static void prv_render_current_steps(GContext *ctx, Layer *base_layer) {
110110
snprintf(buffer, sizeof(buffer), EM_DASH);
111111
}
112112

113-
const int y = PBL_IF_RECT_ELSE(PBL_IF_BW_ELSE(85, 83), 88) + HEALTH_Y_OFFSET;
113+
// Mirror the pill's downshift at half the offset so the step count and
114+
// pill stay visually balanced. Zero on legacy-sized displays where
115+
// HEALTH_Y_OFFSET itself is 0.
116+
const int y = PBL_IF_RECT_ELSE(PBL_IF_BW_ELSE(85, 83), 88) + HEALTH_Y_OFFSET
117+
+ HEALTH_Y_OFFSET / 6;
114118
graphics_context_set_text_color(ctx, CURRENT_TEXT_COLOR);
115119
graphics_draw_text(ctx, buffer, font,
116120
GRect(0, y, base_layer->bounds.size.w, 40),

src/fw/apps/system/health/ui.c

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,13 @@ void health_ui_render_typical_text_box(GContext *ctx, Layer *layer, const char *
7070
const bool is_split = PBL_IF_COLOR_ELSE(daily_total > 0 && bin_minute >= 0, false);
7171
const int pill_height = is_split ? 53 : PBL_IF_RECT_ELSE(35, 36);
7272

73-
const int y = PBL_IF_RECT_ELSE(PBL_IF_BW_ELSE(122, 120), 125) + HEALTH_Y_OFFSET;
73+
// Push the pill lower by a third of the display's vertical health-offset.
74+
// Scales to the slack available — zero on legacy-sized displays (asterix,
75+
// flint), a few px on taller displays (obelix, getafix). Applies to both
76+
// activity and sleep cards on those taller displays; the extra breathing
77+
// room reads better on both.
78+
const int y = PBL_IF_RECT_ELSE(PBL_IF_BW_ELSE(122, 120), 125) + HEALTH_Y_OFFSET
79+
+ HEALTH_Y_OFFSET / 3;
7480
GRect rect = GRect(0, y, layer->bounds.size.w, pill_height);
7581
#if PBL_RECT
7682
rect = grect_inset(rect, GEdgeInsets(0, HEALTH_INSET));
@@ -123,10 +129,14 @@ void health_ui_render_typical_text_box(GContext *ctx, Layer *layer, const char *
123129

124130
const char *total_label = i18n_get("TOTAL", layer);
125131

126-
// Row 2: subheaders (TOTAL | time). Reserve room below the header so the
127-
// subheaders aren't crowded against the TYPICAL line.
128-
GRect sub_left = GRect(rect.origin.x, rect.origin.y + 19,
129-
rect.size.w / 2, 14);
132+
// Row 2: subheaders (time | TOTAL). Reserve room below the header so the
133+
// subheaders aren't crowded against the TYPICAL line. On round we narrow
134+
// the column band so the two halves sit closer to the pill's center
135+
// instead of marooned at the round display's edges.
136+
const int16_t col_band_inset = PBL_IF_RECT_ELSE(0, 40);
137+
const int16_t col_w = (rect.size.w - 2 * col_band_inset) / 2;
138+
GRect sub_left = GRect(rect.origin.x + col_band_inset, rect.origin.y + 19,
139+
col_w, 14);
130140
GRect sub_right = sub_left;
131141
sub_right.origin.x += sub_left.size.w;
132142
graphics_draw_text(ctx, time_text, small_font, sub_left,
-23 Bytes
2 Bytes
-24 Bytes
1 Byte
-19 Bytes
2 Bytes
-23 Bytes
4 Bytes

0 commit comments

Comments
 (0)