summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/WatchFaceInfineat.cpp
diff options
context:
space:
mode:
authorDiego Miguel <dmlls@diegomiguel.me>2022-04-04 20:48:39 +0200
committerDiego Miguel <dmlls@diegomiguel.me>2022-06-11 16:57:24 +0200
commit603af7c372bbd1c36e72ba9ef0e80c1ad8b1a438 (patch)
treec0b9a04eb9f8cda571ed2486f21cb81336496f6b /src/displayapp/screens/WatchFaceInfineat.cpp
parentcb2131ec2cc26a55131192e86287dd6f5fe3e472 (diff)
Better alignment of the date label
Diffstat (limited to 'src/displayapp/screens/WatchFaceInfineat.cpp')
-rw-r--r--src/displayapp/screens/WatchFaceInfineat.cpp36
1 files changed, 14 insertions, 22 deletions
diff --git a/src/displayapp/screens/WatchFaceInfineat.cpp b/src/displayapp/screens/WatchFaceInfineat.cpp
index c5c18d0d..215a7db6 100644
--- a/src/displayapp/screens/WatchFaceInfineat.cpp
+++ b/src/displayapp/screens/WatchFaceInfineat.cpp
@@ -193,27 +193,21 @@ WatchFaceInfineat::WatchFaceInfineat(DisplayApp* app,
lv_label_set_text(labelTimeAmPm, "");
lv_obj_align(labelTimeAmPm, timeContainer, LV_ALIGN_OUT_RIGHT_TOP, 0, 15);
- dateContainer = lv_obj_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_bg_opa(dateContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
- lv_obj_set_size(dateContainer, 40, 50);
- lv_obj_align(dateContainer, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 5);
-
- labelDateDay = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_color(labelDateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
- lv_obj_set_style_local_text_font(labelDateDay, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
- lv_obj_align(labelDateDay, dateContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
- lv_label_set_text(labelDateDay, "Mon");
-
- labelDateNum = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_color(labelDateNum, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
- lv_obj_set_style_local_text_font(labelDateNum, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20);
- lv_obj_align(labelDateNum, dateContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
- lv_label_set_text(labelDateNum, "01");
+ dateBleContainer = lv_obj_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_bg_opa(dateBleContainer, LV_BTN_PART_MAIN, LV_STATE_DEFAULT, LV_OPA_TRANSP);
+ lv_obj_set_size(dateBleContainer, 60, 30);
+ lv_obj_align(dateBleContainer, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
+
+ labelDate = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_text_color(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
+ lv_obj_set_style_local_text_font(labelDate, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &teko_28);
+ lv_obj_align(labelDate, dateBleContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
+ lv_label_set_text(labelDate, "Mon 01");
bleIcon = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(bleIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
lv_label_set_text(bleIcon, Symbols::bluetooth);
- lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 7);
+ lv_obj_align(bleIcon, dateBleContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
stepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999));
@@ -471,10 +465,8 @@ void WatchFaceInfineat::Refresh() {
}
if ((year != currentYear) || (month != currentMonth) || (dayOfWeek != currentDayOfWeek) || (day != currentDay)) {
- lv_label_set_text_fmt(labelDateDay, "%s", dateTimeController.DayOfWeekShortToStringLow());
- lv_label_set_text_fmt(labelDateNum, "%02d", day);
- lv_obj_align(labelDateDay, dateContainer, LV_ALIGN_IN_TOP_MID, 0, 0);
- lv_obj_align(labelDateNum, dateContainer, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
+ lv_label_set_text_fmt(labelDate, "%s %02d", dateTimeController.DayOfWeekShortToStringLow(), day);
+ lv_obj_realign(labelDate);
currentYear = year;
currentMonth = month;
@@ -504,7 +496,7 @@ void WatchFaceInfineat::Refresh() {
bleRadioEnabled = bleController.IsRadioEnabled();
if (bleState.IsUpdated()) {
lv_label_set_text(bleIcon, BleIcon::GetIcon(bleState.Get()));
- lv_obj_align(bleIcon, dateContainer, LV_ALIGN_OUT_BOTTOM_MID, 0, 3);
+ lv_obj_realign(bleIcon);
}
stepCount = motionController.NbSteps();