From bb743689e1e96ff52501c4e34d23f80815c87db9 Mon Sep 17 00:00:00 2001 From: Ryan Rix Date: Sun, 9 Jun 2024 00:11:00 -0700 Subject: [PATCH] vulf-ify me captain --- src/displayapp/screens/WatchFaceFuzzy.cpp | 21 ++++++++++++++++++--- src/libs/sunset | 1 + 2 files changed, 19 insertions(+), 3 deletions(-) create mode 160000 src/libs/sunset diff --git a/src/displayapp/screens/WatchFaceFuzzy.cpp b/src/displayapp/screens/WatchFaceFuzzy.cpp index 92913bbd..3d70bd17 100644 --- a/src/displayapp/screens/WatchFaceFuzzy.cpp +++ b/src/displayapp/screens/WatchFaceFuzzy.cpp @@ -56,9 +56,9 @@ WatchFaceFuzzy::WatchFaceFuzzy(Controllers::DateTime& dateTimeController, lv_obj_set_style_local_text_color(label_date, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x999999)); label_time = lv_label_create(lv_scr_act(), nullptr); - lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed); - - lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); + lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_bold_20); + lv_label_set_recolor(label_time, true); + lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_LEFT_MID, 0, 0); heartbeatIcon = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_static(heartbeatIcon, Symbols::heartBeat); @@ -104,6 +104,19 @@ void WatchFaceFuzzy::Refresh() { uint8_t minute = dateTimeController.Minutes(); printTimeWords(hour, minute); + + currentDateTime = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); + if (currentDate.IsUpdated()) { + uint16_t year = dateTimeController.Year(); + uint8_t day = dateTimeController.Day(); + lv_label_set_text_fmt(label_date, + "%s %d %s %d", + dateTimeController.DayOfWeekShortToString(), + day, + dateTimeController.MonthShortToString(), + year); + lv_obj_realign(label_date); + } } heartbeat = heartRateController.HeartRate(); @@ -178,5 +191,7 @@ void WatchFaceFuzzy::printTimeWords(int h, int m) { sprintf(timeStr, "#ffffff %s#\n#808080 to# #FFFFFF %s#", mod, nums[(h+1) % 12]); } + printf("%s\n", timeStr); lv_label_set_text(label_time, timeStr); + lv_obj_realign(label_time); } diff --git a/src/libs/sunset b/src/libs/sunset new file mode 160000 index 00000000..4b08734e --- /dev/null +++ b/src/libs/sunset @@ -0,0 +1 @@ +Subproject commit 4b08734eb8856154d7226bfdced91a571fb6a64b