static void prv_draw_menu_row(GContext *ctx, const Layer *cell_layer, MenuIndex *cell_index, void *callback_context) { char time_buf[6]; char state_buf[13]; char number_buf[4]; TrainTrip trip; TrainTime *time = &s_times[cell_index->row]; trip_get(time->trip, &trip); snprintf(number_buf, sizeof(number_buf), "%d", trip.trip_name); train_time_format_minutes(time->time, sizeof(time_buf), time_buf); train_time_format_state(time, sizeof(state_buf), state_buf); graphics_context_set_text_color(ctx, GColorBlack); graphics_draw_text(ctx, time_buf, fonts_get_system_font(FONT_KEY_BITHAM_34_MEDIUM_NUMBERS), GRect(0, -5, 114, 43), GTextOverflowModeFill, GTextAlignmentLeft, NULL); graphics_draw_text(ctx, number_buf, fonts_get_system_font(FONT_KEY_GOTHIC_24), GRect(114, -4, 27, 20), GTextOverflowModeFill, GTextAlignmentRight, NULL); }
static void prv_draw_menu_row(GContext *ctx, const Layer *cell_layer, MenuIndex *cell_index, void *menu) { char time_buf[6]; char state_buf[13]; char number_buf[4]; TrainTrip trip; TrainTime *time = &s_times[cell_index->row]; trip_get(time->trip, &trip); snprintf(number_buf, sizeof(number_buf), "%d", trip.trip_name); train_time_format_minutes(time->time, sizeof(time_buf), time_buf); train_time_format_state(time, sizeof(state_buf), state_buf); menu_hack_set_colours(ctx, menu, cell_index); graphics_fill_rect(ctx, layer_get_bounds(cell_layer), 0, GCornerNone); graphics_draw_text(ctx, time_buf, fonts_get_system_font(FONT_KEY_BITHAM_34_MEDIUM_NUMBERS), GRect(0, -5, 114, 43), GTextOverflowModeFill, GTextAlignmentLeft, NULL); graphics_draw_text(ctx, number_buf, fonts_get_system_font(FONT_KEY_GOTHIC_24), GRect(114, -6, 27, 20), GTextOverflowModeFill, GTextAlignmentRight, NULL); #ifdef PBL_COLOR graphics_context_set_fill_color(ctx, trip_get_colour(&trip)); graphics_fill_circle(ctx, GPoint(135, 26), 5); #endif }