Fix text y snapping on Gabbro

This commit is contained in:
2026-07-19 17:53:39 -04:00
parent d84edb5429
commit d8feaa2bb8
2 changed files with 8 additions and 4 deletions
+7 -3
View File
@@ -54,6 +54,7 @@ static bool s_sleep_data_accessible;
static const uint8_t s_wasted_top_text_pixels = 10; // 10 blank pixels above each line of text static const uint8_t s_wasted_top_text_pixels = 10; // 10 blank pixels above each line of text
static const uint16_t s_available_height = PBL_DISPLAY_HEIGHT - s_sleep_bar_drop - PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) + s_wasted_top_text_pixels; static const uint16_t s_available_height = PBL_DISPLAY_HEIGHT - s_sleep_bar_drop - PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) + s_wasted_top_text_pixels;
// static const uint8_t s_max_rows = s_available_height / LW_FONT_SIZE;
static const uint16_t s_screen_center_y = PBL_DISPLAY_HEIGHT / 2; static const uint16_t s_screen_center_y = PBL_DISPLAY_HEIGHT / 2;
static const uint16_t s_base_shift = s_screen_center_y - (LW_FONT_SIZE / 2) - (s_wasted_top_text_pixels / 2); // base - perfect if there is one row static const uint16_t s_base_shift = s_screen_center_y - (LW_FONT_SIZE / 2) - (s_wasted_top_text_pixels / 2); // base - perfect if there is one row
static void write_last_watched(const char *text) { static void write_last_watched(const char *text) {
@@ -67,14 +68,17 @@ static void write_last_watched(const char *text) {
// if the top extends above the sleep bar, force it below it; // if the top extends above the sleep bar, force it below it;
// account for blank pixels above text to avoid forcing position when not visually necessary // account for blank pixels above text to avoid forcing position when not visually necessary
if (y + s_wasted_top_text_pixels < s_sleep_bar_drop) { if (y + s_wasted_top_text_pixels < s_sleep_bar_drop + PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN)) {
y = s_sleep_bar_drop - s_wasted_top_text_pixels + s_available_height; y = s_sleep_bar_drop + PBL_IF_ROUND_ELSE(MARGIN / 2, MARGIN) - s_wasted_top_text_pixels;
#if PBL_DISPLAY_WIDTH >= 260 && PBL_ROUND
y += 3;
#endif
} }
GRect last_watched_frame = layer_get_frame(text_layer_get_layer(s_last_watched_layer)); GRect last_watched_frame = layer_get_frame(text_layer_get_layer(s_last_watched_layer));
last_watched_frame.origin.y = y; last_watched_frame.origin.y = y;
layer_set_frame(text_layer_get_layer(s_last_watched_layer), last_watched_frame); layer_set_frame(text_layer_get_layer(s_last_watched_layer), last_watched_frame);
// APP_LOG(APP_LOG_LEVEL_DEBUG, "height=%d rows=%d/%d", text_size.h, current_rows, s_max_rows); // APP_LOG(APP_LOG_LEVEL_DEBUG, "total height=%d, text height=%d rows=%d/%d", s_available_height, text_size.h, current_rows, s_max_rows);
} }
static bool cb_update_sleep_time(HealthActivity activity, time_t start_time, time_t end_time, void *context) { static bool cb_update_sleep_time(HealthActivity activity, time_t start_time, time_t end_time, void *context) {
+1 -1
View File
@@ -14,7 +14,7 @@ Pebble.addEventListener("appmessage", function (dict) {
// report to user if some configuration is missing // report to user if some configuration is missing
if (!cfg || cfg.CLAY_API_HOST == "" || cfg.CLAY_API_KEY == "" || cfg.CLAY_USER == "") { if (!cfg || cfg.CLAY_API_HOST == "" || cfg.CLAY_API_KEY == "" || cfg.CLAY_USER == "") {
Pebble.sendAppMessage({ PKJS_LAST_WATCHED: "SOME APP SETTINGS ARE UNSET" }); Pebble.sendAppMessage({ PKJS_LAST_WATCHED: "SOME APP SETTINGS ARE UNSET AND THIS IS A TEST TO SEE WHAT CAN FIT ON THE SCREEN OF A PR2 IT SEEMS THE TEST IS SOMETHING EVIL MAKE IT LONGER" });
} }
if (cfg.CLAY_API_IS_JELLYFIN == true) { if (cfg.CLAY_API_IS_JELLYFIN == true) {