diff --git a/src/displayapp/fonts/CMakeLists.txt b/src/displayapp/fonts/CMakeLists.txt index 22627efc..5f046740 100644 --- a/src/displayapp/fonts/CMakeLists.txt +++ b/src/displayapp/fonts/CMakeLists.txt @@ -1,5 +1,5 @@ set(FONTS jetbrains_mono_42 jetbrains_mono_76 jetbrains_mono_bold_20 - jetbrains_mono_extrabold_compressed lv_font_sys_48 + jetbrains_mono_extrabold_compressed jetbrains_mono_extrabold_compressed_luke lv_font_sys_48 open_sans_light fontawesome_weathericons) find_program(LV_FONT_CONV "lv_font_conv" NO_CACHE REQUIRED HINTS "${CMAKE_SOURCE_DIR}/node_modules/.bin") diff --git a/src/displayapp/fonts/fonts.json b/src/displayapp/fonts/fonts.json index 41c383c0..515d80a6 100644 --- a/src/displayapp/fonts/fonts.json +++ b/src/displayapp/fonts/fonts.json @@ -44,6 +44,16 @@ "bpp": 1, "size": 80 }, + "jetbrains_mono_extrabold_compressed_luke": { + "sources": [ + { + "file": "JetBrainsMono-ExtraBold.ttf", + "range": "0x30-0x3a" + } + ], + "bpp": 1, + "size": 50 + }, "open_sans_light": { "sources": [ { diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp index 2e00ee98..80dae6a3 100644 --- a/src/displayapp/screens/WatchFaceDigital.cpp +++ b/src/displayapp/screens/WatchFaceDigital.cpp @@ -56,7 +56,7 @@ WatchFaceDigital::WatchFaceDigital(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_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed_luke); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); @@ -101,11 +101,12 @@ void WatchFaceDigital::Refresh() { lv_label_set_text_static(notificationIcon, NotificationIcon::GetIcon(notificationState.Get())); } - currentDateTime = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); + currentDateTime = std::chrono::time_point_cast(dateTimeController.CurrentDateTime()); if (currentDateTime.IsUpdated()) { uint8_t hour = dateTimeController.Hours(); uint8_t minute = dateTimeController.Minutes(); + uint8_t second = dateTimeController.Seconds(); if (settingsController.GetClockType() == Controllers::Settings::ClockType::H12) { char ampmChar[3] = "AM"; @@ -118,10 +119,10 @@ void WatchFaceDigital::Refresh() { ampmChar[0] = 'P'; } lv_label_set_text(label_time_ampm, ampmChar); - lv_label_set_text_fmt(label_time, "%2d:%02d", hour, minute); + lv_label_set_text_fmt(label_time, "%2d:%02d:%02d", hour, minute, second); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); } else { - lv_label_set_text_fmt(label_time, "%02d:%02d", hour, minute); + lv_label_set_text_fmt(label_time, "%02d:%02d:%02d", hour, minute, second); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_CENTER, 0, 0); } diff --git a/src/displayapp/screens/WatchFaceDigital.h b/src/displayapp/screens/WatchFaceDigital.h index 7bb713cb..eefaaf01 100644 --- a/src/displayapp/screens/WatchFaceDigital.h +++ b/src/displayapp/screens/WatchFaceDigital.h @@ -43,7 +43,7 @@ namespace Pinetime { uint8_t displayedHour = -1; uint8_t displayedMinute = -1; - Utility::DirtyValue> currentDateTime {}; + Utility::DirtyValue> currentDateTime {}; Utility::DirtyValue stepCount {}; Utility::DirtyValue heartbeat {}; Utility::DirtyValue heartbeatRunning {}; diff --git a/src/libs/lv_conf.h b/src/libs/lv_conf.h index c23647f2..5156eb98 100644 --- a/src/libs/lv_conf.h +++ b/src/libs/lv_conf.h @@ -415,6 +415,7 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(jetbrains_mono_bold_20) \ LV_FONT_DECLARE(jetbrains_mono_extrabold_compressed) \ + LV_FONT_DECLARE(jetbrains_mono_extrabold_compressed_luke) \ LV_FONT_DECLARE(jetbrains_mono_42) \ LV_FONT_DECLARE(jetbrains_mono_76) \ LV_FONT_DECLARE(open_sans_light) \