aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorcodingjourney <coding@journey.sk>2024-12-04 05:29:31 +0100
committerJF <JF002@users.noreply.github.com>2025-11-04 21:25:31 +0100
commit526b7844bbdef0f8f252bd96aaf82dbdab9ebdaf (patch)
tree4136ad11d91c8ea84a23d62300f1e774628ba225
parent487205ef6a8e81fe887a1fcd72fee9c4de33c81f (diff)
tweaked some margins to improve aesthetics
-rw-r--r--src/displayapp/screens/StopWatch.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/displayapp/screens/StopWatch.cpp b/src/displayapp/screens/StopWatch.cpp
index ef5ee6f5..fc960113 100644
--- a/src/displayapp/screens/StopWatch.cpp
+++ b/src/displayapp/screens/StopWatch.cpp
@@ -61,7 +61,7 @@ StopWatch::StopWatch(System::SystemTask& systemTask, StopWatchController& stopWa
lv_label_set_long_mode(lapText, LV_LABEL_LONG_BREAK);
lv_label_set_align(lapText, LV_LABEL_ALIGN_CENTER);
lv_obj_set_width(lapText, LV_HOR_RES_MAX);
- lv_obj_align(lapText, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, -btnHeight);
+ lv_obj_align(lapText, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, -btnHeight - 2);
time = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(time, LV_LABEL_PART_MAIN, LV_STATE_DISABLED, Colors::lightGray);
@@ -75,7 +75,7 @@ StopWatch::StopWatch(System::SystemTask& systemTask, StopWatchController& stopWa
msecTime = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DISABLED, Colors::lightGray);
lv_label_set_text_static(msecTime, "00");
- lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
+ lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, -2);
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
@@ -194,7 +194,8 @@ void StopWatch::SetHoursVisible(bool visible) {
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_realign(msecTime);
+ lv_obj_align(time, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, visible ? 5 : 0);
+ lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, visible ? 5 : -2);
displayedLaps = visible ? 4 : 3;
hoursVisible = visible;
if (stopWatchController.GetLapFromHistory(0)) {