Skip to content

Commit 9ad7f42

Browse files
committed
tweaked some margins to improve aesthetics
1 parent 0c402c7 commit 9ad7f42

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/displayapp/screens/StopWatch.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ StopWatch::StopWatch(System::SystemTask& systemTask, StopWatchController& stopWa
6161
lv_label_set_long_mode(lapText, LV_LABEL_LONG_BREAK);
6262
lv_label_set_align(lapText, LV_LABEL_ALIGN_CENTER);
6363
lv_obj_set_width(lapText, LV_HOR_RES_MAX);
64-
lv_obj_align(lapText, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, -btnHeight);
64+
lv_obj_align(lapText, lv_scr_act(), LV_ALIGN_IN_BOTTOM_MID, 0, -btnHeight - 2);
6565

6666
time = lv_label_create(lv_scr_act(), nullptr);
6767
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
7575
msecTime = lv_label_create(lv_scr_act(), nullptr);
7676
lv_obj_set_style_local_text_color(msecTime, LV_LABEL_PART_MAIN, LV_STATE_DISABLED, Colors::lightGray);
7777
lv_label_set_text_static(msecTime, "00");
78-
lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
78+
lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, -2);
7979

8080
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
8181

@@ -194,7 +194,8 @@ void StopWatch::SetHoursVisible(bool visible) {
194194
lv_font_t *font = visible ? &jetbrains_mono_42 : &jetbrains_mono_76;
195195
lv_obj_set_style_local_text_font(time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, font);
196196
lv_obj_set_height(time, font->line_height);
197-
lv_obj_realign(msecTime);
197+
lv_obj_align(time, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, visible ? 5 : 0);
198+
lv_obj_align(msecTime, time, LV_ALIGN_OUT_BOTTOM_MID, 0, visible ? 5 : -2);
198199
displayedLaps = visible ? 4 : 3;
199200
hoursVisible = visible;
200201
if (stopWatchController.GetLapFromHistory(0)) {

0 commit comments

Comments
 (0)