Skip to content

Commit

Permalink
fixed issues found by the test-format CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
codingjourney committed Dec 7, 2024
1 parent 170526e commit 03859f0
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/displayapp/screens/StopWatch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,11 +177,16 @@ void StopWatch::RenderLaps() {
TimeSeparated laptime = ConvertTicksToTimeSegments(lap->timeSinceStart);
char buffer[19];
if (laptime.hours == 0) {
snprintf(buffer, sizeof(buffer), "\n#%-3d %2d:%02d.%02d",
lap->number, laptime.mins, laptime.secs, laptime.hundredths);
snprintf(buffer, sizeof(buffer), "\n#%-3d %2d:%02d.%02d", lap->number, laptime.mins, laptime.secs, laptime.hundredths);
} else {
snprintf(buffer, sizeof(buffer), "\n#%-3d %3d:%02d:%02d.%02d",
lap->number, laptime.hours, laptime.mins, laptime.secs, laptime.hundredths);
snprintf(buffer,
sizeof(buffer),
"\n#%-3d %3d:%02d:%02d.%02d",
lap->number,
laptime.hours,
laptime.mins,
laptime.secs,
laptime.hundredths);
}
lv_label_ins_text(lapText, LV_LABEL_POS_LAST, buffer);
}
Expand All @@ -191,7 +196,7 @@ void StopWatch::RenderLaps() {

void StopWatch::SetHoursVisible(bool visible) {
if (hoursVisible != visible) {
lv_font_t *font = visible ? &jetbrains_mono_42 : &jetbrains_mono_76;
lv_font_t* font = visible ? &jetbrains_mono_42 : &jetbrains_mono_76;
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font);
lv_obj_set_height(time, font->line_height);
lv_obj_align(time, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, visible ? 5 : 0);
Expand Down

0 comments on commit 03859f0

Please sign in to comment.