Reduce font, adjust to 4 sectors per hour, remove broken inline text color

This commit is contained in:
zyphlar 2024-01-05 02:42:02 -08:00
parent 7cd9e8493d
commit 5c87829d65
Signed by: will
GPG Key ID: 1159B930701263F3
2 changed files with 12 additions and 4 deletions

View File

@ -18,7 +18,7 @@
"sources": [ "sources": [
{ {
"file": "JetBrainsMono-Regular.ttf", "file": "JetBrainsMono-Regular.ttf",
"range": "0x25, 0x2b, 0x2d, 0x30-0x3a, 0x4b-0x4d, 0x66, 0x69, 0x6b, 0x6d, 0x74" "range": "0x20, 0x25, 0x27, 0x2b, 0x2d, 0x30-0x3a, 0x4b-0x4d, 0x61-0x7a"
} }
], ],
"bpp": 1, "bpp": 1,

View File

@ -40,7 +40,11 @@ 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)); 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); label_time = lv_label_create(lv_scr_act(), nullptr);
if (settingsController.GetClockType() == Controllers::Settings::ClockType::Fuzzy) {
lv_obj_set_style_local_text_font(label_time, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_42);
} else {
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);
}
lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_RIGHT_MID, 0, 0);
@ -94,8 +98,11 @@ void WatchFaceDigital::Refresh() {
/* Begin difference from WatchFaceDigital*/ /* Begin difference from WatchFaceDigital*/
if (settingsController.GetClockType() == Controllers::Settings::ClockType::Fuzzy) { if (settingsController.GetClockType() == Controllers::Settings::ClockType::Fuzzy) {
std::string hourStr, timeStr; std::string hourStr, timeStr;
hour = hour % 12; // 12 becomes 0, 13 becomes 1
auto sector = minute / 15 + (minute % 15 > 7); auto sector = minute / 15 + (minute % 15 > 7);
if (sector == 12) { // advance the hour modulo 12 and reset the minutes if we're close to the top
// so we get "quarter to $hour+1" instead of needing "three quarters past $hour"
if (sector > 3) {
hour = (hour + 1) % 12; hour = (hour + 1) % 12;
sector = 0; sector = 0;
} }
@ -104,7 +111,8 @@ void WatchFaceDigital::Refresh() {
if (timeStr.find("%1") != std::string::npos) { if (timeStr.find("%1") != std::string::npos) {
hour = (hour + 1) % 12; hour = (hour + 1) % 12;
} }
hourStr = std::string("#") + timeAccent + " " + hourNames[hour] + "#"; //hourStr = std::string("#") + timeAccent + " " + hourNames[hour] + "#";
hourStr = hourNames[hour];
timeStr.replace(timeStr.find("%"), 2, hourStr); timeStr.replace(timeStr.find("%"), 2, hourStr);
lv_label_set_text(label_time, timeStr.c_str()); lv_label_set_text(label_time, timeStr.c_str());