From 800e948196b8d9dba5a853819d408297439a2995 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sat, 8 Jan 2022 08:17:23 -0800 Subject: [PATCH 01/13] Added calendar app --- src/CMakeLists.txt | 1 + src/displayapp/Apps.h | 1 + src/displayapp/DisplayApp.cpp | 8 +++++++ src/displayapp/screens/Calendar.cpp | 35 +++++++++++++++++++++++++++++ src/displayapp/screens/Calendar.h | 24 ++++++++++++++++++++ 5 files changed, 69 insertions(+) create mode 100644 src/displayapp/screens/Calendar.cpp create mode 100644 src/displayapp/screens/Calendar.h diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 062d8a5000..d95edc02e7 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -417,6 +417,7 @@ list(APPEND SOURCE_FILES displayapp/screens/FirmwareUpdate.cpp displayapp/screens/Music.cpp displayapp/screens/Weather.cpp + displayapp/screens/Calendar.cpp displayapp/screens/Navigation.cpp displayapp/screens/Metronome.cpp displayapp/screens/Motion.cpp diff --git a/src/displayapp/Apps.h b/src/displayapp/Apps.h index b876020eac..88ab301937 100644 --- a/src/displayapp/Apps.h +++ b/src/displayapp/Apps.h @@ -16,6 +16,7 @@ namespace Pinetime { FlashLight, BatteryInfo, Music, + Calendar, Paint, Paddle, Twos, diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 7a73f12362..418cbf20e7 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -21,6 +21,7 @@ #include "displayapp/screens/Meter.h" #include "displayapp/screens/Metronome.h" #include "displayapp/screens/Music.h" +#include "displayapp/screens/Calendar.h" #include "displayapp/screens/Navigation.h" #include "displayapp/screens/Notifications.h" #include "displayapp/screens/SystemInfo.h" @@ -237,6 +238,9 @@ void DisplayApp::Refresh() { case TouchEvents::SwipeDown: LoadApp(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); break; + case TouchEvents::SwipeLeft: + LoadApp(Apps::Calendar, DisplayApp::FullRefreshDirections::LeftAnim); + break; case TouchEvents::SwipeRight: LoadApp(Apps::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); break; @@ -447,6 +451,10 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) case Apps::Twos: currentScreen = std::make_unique(this); break; + case Apps::Calendar: + currentScreen = std::make_unique(this, dateTimeController); + ReturnApp(Apps::Clock, FullRefreshDirections::RightAnim, TouchEvents::SwipeRight); + break; case Apps::Paint: currentScreen = std::make_unique(this, lvgl, motorController); break; diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp new file mode 100644 index 0000000000..9e36321ca9 --- /dev/null +++ b/src/displayapp/screens/Calendar.cpp @@ -0,0 +1,35 @@ +#include "displayapp/screens/Calendar.h" +#include "displayapp/DisplayApp.h" +#include "components/datetime/DateTimeController.h" + +using namespace Pinetime::Applications::Screens; + +Calendar::Calendar(DisplayApp* app, Controllers::DateTime& dateTimeController) : Screen(app), dateTimeController {dateTimeController} { + + // Create calendar object + lv_obj_t * calendar = lv_calendar_create(lv_scr_act(), NULL); + // Set size + lv_obj_set_size(calendar, 240, 240); + // Set alignment + lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 0); + + // Set style of today's date + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + // Set style of days of week + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x50, 0x50, 0x50)); + + // Get today's date + lv_calendar_date_t today; + today.year = static_cast(dateTimeController.Year()); + today.month = static_cast(dateTimeController.Month()); + today.day = static_cast(dateTimeController.Day()); + + // Set today's date + lv_calendar_set_today_date(calendar, &today); + lv_calendar_set_showed_date(calendar, &today); + +} + +Calendar::~Calendar() { + lv_obj_clean(lv_scr_act()); +} diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h new file mode 100644 index 0000000000..b87f2688be --- /dev/null +++ b/src/displayapp/screens/Calendar.h @@ -0,0 +1,24 @@ +#pragma once + +#include "displayapp/screens/Screen.h" +#include +#include "components/datetime/DateTimeController.h" + +namespace Pinetime { + namespace Controllers { + class Settings; + } + + namespace Applications { + namespace Screens { + class Calendar : public Screen { + public: + Calendar(DisplayApp* app, + Controllers::DateTime& dateTimeController); + ~Calendar() override; + private: + Controllers::DateTime& dateTimeController; + }; + } + } +} From 498b722d12958d8411ff9e9b132174bdf2f9c505 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sun, 9 Jan 2022 06:00:47 -0800 Subject: [PATCH 02/13] Added status bar to calendar --- src/displayapp/DisplayApp.cpp | 2 +- src/displayapp/screens/Calendar.cpp | 18 ++++++++++++++---- src/displayapp/screens/Calendar.h | 5 +++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 418cbf20e7..75139ae2ea 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -452,7 +452,7 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) currentScreen = std::make_unique(this); break; case Apps::Calendar: - currentScreen = std::make_unique(this, dateTimeController); + currentScreen = std::make_unique(this, batteryController,dateTimeController); ReturnApp(Apps::Clock, FullRefreshDirections::RightAnim, TouchEvents::SwipeRight); break; case Apps::Paint: diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 9e36321ca9..cba8e53395 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -1,22 +1,32 @@ #include "displayapp/screens/Calendar.h" #include "displayapp/DisplayApp.h" #include "components/datetime/DateTimeController.h" +#include "displayapp/screens/BatteryIcon.h" using namespace Pinetime::Applications::Screens; -Calendar::Calendar(DisplayApp* app, Controllers::DateTime& dateTimeController) : Screen(app), dateTimeController {dateTimeController} { +Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryController, Controllers::DateTime& dateTimeController) : Screen(app), batteryController {batteryController}, dateTimeController {dateTimeController} { + + // Statusbar clock and battery + label_time = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); + lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0); + batteryIcon = lv_label_create(lv_scr_act(), nullptr); + lv_label_set_text(batteryIcon, BatteryIcon::GetBatteryIcon(batteryController.PercentRemaining())); + lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); // Create calendar object lv_obj_t * calendar = lv_calendar_create(lv_scr_act(), NULL); // Set size - lv_obj_set_size(calendar, 240, 240); + lv_obj_set_size(calendar, 240, 200); // Set alignment - lv_obj_align(calendar, NULL, LV_ALIGN_CENTER, 0, 0); + lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); // Set style of today's date lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); // Set style of days of week - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, LV_COLOR_MAKE(0x50, 0x50, 0x50)); + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, lv_color_hex(0x505050)); // Get today's date lv_calendar_date_t today; diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h index b87f2688be..d99d2284c5 100644 --- a/src/displayapp/screens/Calendar.h +++ b/src/displayapp/screens/Calendar.h @@ -3,6 +3,7 @@ #include "displayapp/screens/Screen.h" #include #include "components/datetime/DateTimeController.h" +#include "components/battery/BatteryController.h" namespace Pinetime { namespace Controllers { @@ -14,10 +15,14 @@ namespace Pinetime { class Calendar : public Screen { public: Calendar(DisplayApp* app, + Pinetime::Controllers::Battery& batteryController, Controllers::DateTime& dateTimeController); ~Calendar() override; private: + Pinetime::Controllers::Battery& batteryController; Controllers::DateTime& dateTimeController; + lv_obj_t* batteryIcon; + lv_obj_t* label_time; }; } } From 42aa879eb3bd0f7e5f363ab5c345b7f357cd6a49 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sun, 9 Jan 2022 06:01:32 -0800 Subject: [PATCH 03/13] Fixed crashing by disabling clicks --- src/displayapp/screens/Calendar.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index cba8e53395..4b7371d487 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -22,6 +22,8 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr lv_obj_set_size(calendar, 240, 200); // Set alignment lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); + // Disable clicks + lv_obj_set_click(calendar, false); // Set style of today's date lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); From 67ffa04fa63deaf3a6aa796b366ab09d327173c0 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sun, 9 Jan 2022 17:36:21 -0800 Subject: [PATCH 04/13] Styled inactive months and removed styling from days of the week --- src/displayapp/screens/Calendar.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 4b7371d487..f5c89ca768 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -27,8 +27,10 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr // Set style of today's date lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + // Set style of inactive month's days + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); // Set style of days of week - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, lv_color_hex(0x505050)); + //lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, lv_color_hex(0x505050)); // Get today's date lv_calendar_date_t today; From bf546cac334a8488ba18e7ae91d9626d5ff13b38 Mon Sep 17 00:00:00 2001 From: thnikk Date: Mon, 10 Jan 2022 06:03:03 -0800 Subject: [PATCH 05/13] Added month navigation with up and down swipes --- src/displayapp/screens/Calendar.cpp | 44 ++++++++++++++++++++++++----- src/displayapp/screens/Calendar.h | 4 +++ 2 files changed, 41 insertions(+), 7 deletions(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index f5c89ca768..996dcf6c1e 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -7,7 +7,7 @@ using namespace Pinetime::Applications::Screens; Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryController, Controllers::DateTime& dateTimeController) : Screen(app), batteryController {batteryController}, dateTimeController {dateTimeController} { - // Statusbar clock and battery + // Status bar clock and battery label_time = lv_label_create(lv_scr_act(), nullptr); lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); @@ -17,11 +17,11 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr lv_obj_align(batteryIcon, nullptr, LV_ALIGN_IN_TOP_RIGHT, 0, 0); // Create calendar object - lv_obj_t * calendar = lv_calendar_create(lv_scr_act(), NULL); + calendar = lv_calendar_create(lv_scr_act(), NULL); // Set size - lv_obj_set_size(calendar, 240, 200); + lv_obj_set_size(calendar, 230, 200); // Set alignment - lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, 0); + lv_obj_align(calendar, NULL, LV_ALIGN_IN_BOTTOM_MID, 0, -5); // Disable clicks lv_obj_set_click(calendar, false); @@ -29,11 +29,8 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); // Set style of inactive month's days lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); - // Set style of days of week - //lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DAY_NAMES, LV_STATE_DEFAULT, lv_color_hex(0x505050)); // Get today's date - lv_calendar_date_t today; today.year = static_cast(dateTimeController.Year()); today.month = static_cast(dateTimeController.Month()); today.day = static_cast(dateTimeController.Day()); @@ -42,6 +39,39 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr lv_calendar_set_today_date(calendar, &today); lv_calendar_set_showed_date(calendar, &today); + // Use today's date as a reference for which month to show if moved + current = today; + +} + +bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { + switch (event) { + case TouchEvents::SwipeUp: { + if (current.month == 12) { + current.month = 1; + current.year++; + } + else{ + current.month++; + } + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + case TouchEvents::SwipeDown: { + if (current.month == 1) { + current.month = 12; + current.year--; + } + else{ + current.month--; + } + lv_calendar_set_showed_date(calendar, ¤t); + return true; + } + default: { + return false; + } + } } Calendar::~Calendar() { diff --git a/src/displayapp/screens/Calendar.h b/src/displayapp/screens/Calendar.h index d99d2284c5..66f4d6e09d 100644 --- a/src/displayapp/screens/Calendar.h +++ b/src/displayapp/screens/Calendar.h @@ -19,10 +19,14 @@ namespace Pinetime { Controllers::DateTime& dateTimeController); ~Calendar() override; private: + bool OnTouchEvent(TouchEvents event); Pinetime::Controllers::Battery& batteryController; Controllers::DateTime& dateTimeController; lv_obj_t* batteryIcon; lv_obj_t* label_time; + lv_obj_t * calendar; + lv_calendar_date_t today; + lv_calendar_date_t current; }; } } From 364a6cfcbf76ff405d5b5842263b2ca7e6560055 Mon Sep 17 00:00:00 2001 From: thnikk Date: Fri, 14 Jan 2022 04:48:06 -0800 Subject: [PATCH 06/13] Changed today highlighting from red to an inverted background --- src/displayapp/screens/Calendar.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 996dcf6c1e..9a57a02d43 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -25,8 +25,14 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr // Disable clicks lv_obj_set_click(calendar, false); + // Set background of today's date + lv_obj_set_style_local_bg_opa(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_OPA_COVER); + lv_obj_set_style_local_bg_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_WHITE); + lv_obj_set_style_local_radius(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, 3); + // Set style of today's date - lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_RED); + lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_FOCUSED, LV_COLOR_BLACK); + // Set style of inactive month's days lv_obj_set_style_local_text_color(calendar, LV_CALENDAR_PART_DATE, LV_STATE_DISABLED, lv_color_hex(0x505050)); From b2fe1a29719afc267a555011ca037dbcd1b4faa8 Mon Sep 17 00:00:00 2001 From: thnikk Date: Fri, 15 Apr 2022 20:30:14 -0700 Subject: [PATCH 07/13] Moved calendar to app --- src/displayapp/DisplayApp.cpp | 4 ---- src/displayapp/screens/ApplicationList.cpp | 22 +++++++++------------- src/displayapp/screens/ApplicationList.h | 4 ++-- 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/src/displayapp/DisplayApp.cpp b/src/displayapp/DisplayApp.cpp index 75139ae2ea..0c739a2c0c 100644 --- a/src/displayapp/DisplayApp.cpp +++ b/src/displayapp/DisplayApp.cpp @@ -238,9 +238,6 @@ void DisplayApp::Refresh() { case TouchEvents::SwipeDown: LoadApp(Apps::Notifications, DisplayApp::FullRefreshDirections::Down); break; - case TouchEvents::SwipeLeft: - LoadApp(Apps::Calendar, DisplayApp::FullRefreshDirections::LeftAnim); - break; case TouchEvents::SwipeRight: LoadApp(Apps::QuickSettings, DisplayApp::FullRefreshDirections::RightAnim); break; @@ -453,7 +450,6 @@ void DisplayApp::LoadApp(Apps app, DisplayApp::FullRefreshDirections direction) break; case Apps::Calendar: currentScreen = std::make_unique(this, batteryController,dateTimeController); - ReturnApp(Apps::Clock, FullRefreshDirections::RightAnim, TouchEvents::SwipeRight); break; case Apps::Paint: currentScreen = std::make_unique(this, lvgl, motorController); diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 29c8affbc6..951372cd90 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -25,7 +25,9 @@ ApplicationList::ApplicationList(Pinetime::Applications::DisplayApp* app, [this]() -> std::unique_ptr { return CreateScreen2(); }, - //[this]() -> std::unique_ptr { return CreateScreen3(); } + [this]() -> std::unique_ptr { + return CreateScreen3(); + } }, Screens::ScreenListModes::UpDown} { } @@ -48,7 +50,7 @@ std::unique_ptr ApplicationList::CreateScreen1() { {Symbols::hourGlass, Apps::Timer}, }}; - return std::make_unique(0, 2, app, settingsController, batteryController, dateTimeController, applications); + return std::make_unique(0, 3, app, settingsController, batteryController, dateTimeController, applications); } std::unique_ptr ApplicationList::CreateScreen2() { @@ -61,19 +63,13 @@ std::unique_ptr ApplicationList::CreateScreen2() { {Symbols::clock, Apps::Alarm}, }}; - return std::make_unique(1, 2, app, settingsController, batteryController, dateTimeController, applications); + return std::make_unique(1, 3, app, settingsController, batteryController, dateTimeController, applications); } -/*std::unique_ptr ApplicationList::CreateScreen3() { +std::unique_ptr ApplicationList::CreateScreen3() { std::array applications { - {{"A", Apps::Meter}, - {"B", Apps::Navigation}, - {"C", Apps::Clock}, - {"D", Apps::Music}, - {"E", Apps::SysInfo}, - {"F", Apps::Brightness} - } - }; + {{Symbols::calendar, Apps::Calendar} + }}; return std::make_unique(2, 3, app, settingsController, batteryController, dateTimeController, applications); -}*/ +} diff --git a/src/displayapp/screens/ApplicationList.h b/src/displayapp/screens/ApplicationList.h index f430a89ef1..27ebbac94d 100644 --- a/src/displayapp/screens/ApplicationList.h +++ b/src/displayapp/screens/ApplicationList.h @@ -25,10 +25,10 @@ namespace Pinetime { Pinetime::Controllers::Battery& batteryController; Controllers::DateTime& dateTimeController; - ScreenList<2> screens; + ScreenList<3> screens; std::unique_ptr CreateScreen1(); std::unique_ptr CreateScreen2(); - // std::unique_ptr CreateScreen3(); + std::unique_ptr CreateScreen3(); }; } } From 63f14a36eeaa7717b63385a356fe219a84889381 Mon Sep 17 00:00:00 2001 From: thnikk Date: Fri, 15 Apr 2022 20:30:54 -0700 Subject: [PATCH 08/13] Added symbol for calendar icon --- src/displayapp/fonts/README.md | 2 +- src/displayapp/fonts/jetbrains_mono_bold_20.c | 78 +++++++++++-------- src/displayapp/screens/Symbols.h | 1 + 3 files changed, 46 insertions(+), 35 deletions(-) diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index 8a26084613..aa7698e33c 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -13,7 +13,7 @@ * Do not enable font compression and horizontal subpixel hinting * Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range : `0x20-0x7f, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015` + range : `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf073` * Click on Convert, and download the file `jetbrains_mono_bold_20.c` and copy it in `src/DisplayApp/Fonts` * Add the font .c file path to src/CMakeLists.txt * Add an LV_FONT_DECLARE line in src/libs/lv_conf.h diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index d8705528ce..465eef6cdd 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -1,7 +1,7 @@ /******************************************************************************* * Size: 20 px * Bpp: 1 - * Opts: + * Opts: ******************************************************************************/ #ifdef LV_LVGL_H_INCLUDE_SIMPLE @@ -88,8 +88,8 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xe, 0x3, 0x80, 0xc0, 0x70, 0x18, 0xe, 0x0, /* U+0030 "0" */ - 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7f, - 0xdf, 0xf7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, + 0x3f, 0x1f, 0xef, 0x3f, 0x87, 0xe1, 0xf8, 0x7e, + 0xdf, 0xb7, 0xe1, 0xf8, 0x7e, 0x1f, 0xcf, 0x7f, 0x8f, 0xc0, /* U+0031 "1" */ @@ -840,6 +840,14 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf8, 0xf, 0x80, 0xf8, 0x3e, 0x0, 0xff, 0xf0, 0x0, 0x3f, 0x80, 0x0, + /* U+F073 "" */ + 0x4, 0x8, 0x3, 0x87, 0x0, 0xe1, 0xc1, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x73, + 0x9f, 0x9c, 0xe7, 0xe7, 0x39, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x9c, 0xe7, 0xe7, 0x39, 0xf9, 0xce, + 0x7f, 0xff, 0xfd, 0xff, 0xfe, + /* U+F095 "" */ 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x7, 0xf0, 0x0, 0x7f, 0x0, 0x7, 0xf0, 0x0, 0xff, 0x0, @@ -1220,31 +1228,32 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3028, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, {.bitmap_index = 3056, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3104, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3148, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3201, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3220, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3270, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3306, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3354, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3394, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3437, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3475, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3513, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3551, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3589, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3627, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3663, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 3701, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3730, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 3768, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3834, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3883, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3933, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3993, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4046, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4107, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4162, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4215, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} + {.bitmap_index = 3148, .adv_w = 280, .box_w = 18, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3193, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3246, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3265, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3315, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3351, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3399, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3439, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3482, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3520, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3558, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3596, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3634, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3672, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3708, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3746, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3775, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 3813, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3879, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3928, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3978, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4038, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4091, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4152, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4207, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4260, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} }; /*--------------------- @@ -1253,10 +1262,11 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { static const uint16_t unicode_list_2[] = { 0x0, 0x14, 0x16, 0x23, 0x26, 0x27, 0x28, 0x39, - 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x94, - 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, 0x240, - 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, 0x3dc, - 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, 0x6a8 + 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x72, + 0x94, 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, + 0x240, 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, + 0x3dc, 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, + 0x6a8 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1272,7 +1282,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 61441, .range_length = 1705, .glyph_id_start = 160, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 40, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 41, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; @@ -1321,7 +1331,7 @@ lv_font_t jetbrains_mono_bold_20 = { #if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0) .subpx = LV_FONT_SUBPX_NONE, #endif -#if LV_VERSION_CHECK(7, 4, 0) +#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8 .underline_position = -3, .underline_thickness = 1, #endif diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index e68a7af6b2..f73d8847ba 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -44,6 +44,7 @@ namespace Pinetime { static constexpr const char* chartLine = "\xEF\x88\x81"; static constexpr const char* eye = "\xEF\x81\xAE"; static constexpr const char* home = "\xEF\x80\x95"; + static constexpr const char* calendar = "\xEF\x81\xB3"; // lv_font_sys_48.c static constexpr const char* settings = "\xEE\xA4\x82"; // e902 From daf691251dcac0d72013fef21d4e26bfca75205f Mon Sep 17 00:00:00 2001 From: thnikk Date: Sat, 16 Apr 2022 01:42:13 -0700 Subject: [PATCH 09/13] Re-added calendar icon --- src/displayapp/fonts/jetbrains_mono_bold_20.c | 70 +++++++++++-------- src/displayapp/screens/ApplicationList.cpp | 2 +- src/displayapp/screens/Symbols.h | 1 + 3 files changed, 42 insertions(+), 31 deletions(-) diff --git a/src/displayapp/fonts/jetbrains_mono_bold_20.c b/src/displayapp/fonts/jetbrains_mono_bold_20.c index 5c40d4949e..20076e1f78 100644 --- a/src/displayapp/fonts/jetbrains_mono_bold_20.c +++ b/src/displayapp/fonts/jetbrains_mono_bold_20.c @@ -840,6 +840,14 @@ static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = { 0xf8, 0xf, 0x80, 0xf8, 0x3e, 0x0, 0xff, 0xf0, 0x0, 0x3f, 0x80, 0x0, + /* U+F073 "" */ + 0x4, 0x8, 0x3, 0x87, 0x0, 0xe1, 0xc1, 0xff, + 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, + 0x0, 0x0, 0xff, 0xff, 0xff, 0xff, 0xfe, 0x73, + 0x9f, 0x9c, 0xe7, 0xe7, 0x39, 0xff, 0xff, 0xff, + 0xff, 0xff, 0x9c, 0xe7, 0xe7, 0x39, 0xf9, 0xce, + 0x7f, 0xff, 0xfd, 0xff, 0xfe, + /* U+F095 "" */ 0x0, 0x0, 0x0, 0x0, 0x3e, 0x0, 0x7, 0xf0, 0x0, 0x7f, 0x0, 0x7, 0xf0, 0x0, 0xff, 0x0, @@ -1220,31 +1228,32 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { {.bitmap_index = 3027, .adv_w = 280, .box_w = 13, .box_h = 17, .ofs_x = 2, .ofs_y = -1}, {.bitmap_index = 3055, .adv_w = 320, .box_w = 19, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, {.bitmap_index = 3103, .adv_w = 360, .box_w = 23, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3147, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3200, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3219, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3269, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3305, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3353, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, - {.bitmap_index = 3393, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3436, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3474, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3512, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3550, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3588, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, - {.bitmap_index = 3626, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3662, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, - {.bitmap_index = 3700, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3729, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, - {.bitmap_index = 3767, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 3833, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, - {.bitmap_index = 3882, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3932, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 3992, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4045, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, - {.bitmap_index = 4106, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4161, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, - {.bitmap_index = 4214, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} + {.bitmap_index = 3147, .adv_w = 280, .box_w = 18, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3192, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3245, .adv_w = 120, .box_w = 8, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3264, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3314, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3350, .adv_w = 320, .box_w = 20, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3398, .adv_w = 320, .box_w = 21, .box_h = 15, .ofs_x = 0, .ofs_y = 0}, + {.bitmap_index = 3438, .adv_w = 320, .box_w = 20, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3481, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3519, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3557, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3595, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3633, .adv_w = 400, .box_w = 25, .box_h = 12, .ofs_x = 0, .ofs_y = 1}, + {.bitmap_index = 3671, .adv_w = 240, .box_w = 15, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3707, .adv_w = 280, .box_w = 15, .box_h = 20, .ofs_x = 1, .ofs_y = -3}, + {.bitmap_index = 3745, .adv_w = 200, .box_w = 11, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3774, .adv_w = 280, .box_w = 16, .box_h = 19, .ofs_x = 1, .ofs_y = -2}, + {.bitmap_index = 3812, .adv_w = 400, .box_w = 25, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 3878, .adv_w = 360, .box_w = 23, .box_h = 17, .ofs_x = 0, .ofs_y = -1}, + {.bitmap_index = 3927, .adv_w = 320, .box_w = 20, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 3977, .adv_w = 400, .box_w = 25, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4037, .adv_w = 320, .box_w = 20, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4090, .adv_w = 360, .box_w = 23, .box_h = 21, .ofs_x = 0, .ofs_y = -3}, + {.bitmap_index = 4151, .adv_w = 360, .box_w = 22, .box_h = 20, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4206, .adv_w = 360, .box_w = 22, .box_h = 19, .ofs_x = 0, .ofs_y = -2}, + {.bitmap_index = 4259, .adv_w = 320, .box_w = 20, .box_h = 15, .ofs_x = 0, .ofs_y = 0} }; /*--------------------- @@ -1253,10 +1262,11 @@ static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = { static const uint16_t unicode_list_2[] = { 0x0, 0x14, 0x16, 0x23, 0x26, 0x27, 0x28, 0x39, - 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x94, - 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, 0x240, - 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, 0x3dc, - 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, 0x6a8 + 0x47, 0x4a, 0x4b, 0x4c, 0x50, 0x68, 0x6d, 0x72, + 0x94, 0x128, 0x184, 0x1e5, 0x1fb, 0x200, 0x21d, 0x23f, + 0x240, 0x241, 0x242, 0x243, 0x251, 0x292, 0x293, 0x2f1, + 0x3dc, 0x3fc, 0x45c, 0x54a, 0x55f, 0x568, 0x59e, 0x59f, + 0x6a8 }; /*Collect the unicode lists and glyph_id offsets*/ @@ -1272,7 +1282,7 @@ static const lv_font_fmt_txt_cmap_t cmaps[] = }, { .range_start = 61441, .range_length = 1705, .glyph_id_start = 160, - .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 40, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY + .unicode_list = unicode_list_2, .glyph_id_ofs_list = NULL, .list_length = 41, .type = LV_FONT_FMT_TXT_CMAP_SPARSE_TINY } }; diff --git a/src/displayapp/screens/ApplicationList.cpp b/src/displayapp/screens/ApplicationList.cpp index 9aef19f862..951372cd90 100644 --- a/src/displayapp/screens/ApplicationList.cpp +++ b/src/displayapp/screens/ApplicationList.cpp @@ -68,7 +68,7 @@ std::unique_ptr ApplicationList::CreateScreen2() { std::unique_ptr ApplicationList::CreateScreen3() { std::array applications { - {{"C", Apps::Calendar} + {{Symbols::calendar, Apps::Calendar} }}; return std::make_unique(2, 3, app, settingsController, batteryController, dateTimeController, applications); diff --git a/src/displayapp/screens/Symbols.h b/src/displayapp/screens/Symbols.h index e68a7af6b2..f73d8847ba 100644 --- a/src/displayapp/screens/Symbols.h +++ b/src/displayapp/screens/Symbols.h @@ -44,6 +44,7 @@ namespace Pinetime { static constexpr const char* chartLine = "\xEF\x88\x81"; static constexpr const char* eye = "\xEF\x81\xAE"; static constexpr const char* home = "\xEF\x80\x95"; + static constexpr const char* calendar = "\xEF\x81\xB3"; // lv_font_sys_48.c static constexpr const char* settings = "\xEE\xA4\x82"; // e902 From ab614a7d14f836ad50a0c6a2e53c7127746465d4 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sat, 16 Apr 2022 01:46:42 -0700 Subject: [PATCH 10/13] Add calendar icon to range --- src/displayapp/fonts/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/fonts/README.md b/src/displayapp/fonts/README.md index c7a8e2bf8a..0d51515765 100644 --- a/src/displayapp/fonts/README.md +++ b/src/displayapp/fonts/README.md @@ -31,7 +31,7 @@ static constexpr const char* newSymbol = "\xEF\x86\x85"; * Do not enable font compression or horizontal subpixel rendering * Load the file `JetBrainsMono-Bold.tff` (use the file in this repo to ensure the version matches) and specify the following range: `0x20-0x7e, 0x410-0x44f` * Add a 2nd font, load the file `FontAwesome5-Solid+Brands+Regular.woff` and specify the following - range: `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015` + range: `0xf293, 0xf294, 0xf244, 0xf240, 0xf242, 0xf243, 0xf241, 0xf54b, 0xf21e, 0xf1e6, 0xf54b, 0xf017, 0xf129, 0xf03a, 0xf185, 0xf560, 0xf001, 0xf3fd, 0xf069, 0xf1fc, 0xf45d, 0xf59f, 0xf5a0, 0xf029, 0xf027, 0xf028, 0xf6a9, 0xf04b, 0xf04c, 0xf048, 0xf051, 0xf095, 0xf3dd, 0xf04d, 0xf2f2, 0xf024, 0xf252, 0xf569, 0xf201, 0xf06e, 0xf015, 0xf073` * Fix an error in the font conversion. Replace the following: From 3d3474a8d474853dfd087a1b60c56172b86bb545 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sat, 16 Apr 2022 02:10:13 -0700 Subject: [PATCH 11/13] Changed swipe directions in calendar --- src/displayapp/screens/Calendar.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 9a57a02d43..86a85ebe7c 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -52,7 +52,7 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { switch (event) { - case TouchEvents::SwipeUp: { + case TouchEvents::SwipeLeft: { if (current.month == 12) { current.month = 1; current.year++; @@ -63,7 +63,7 @@ bool Calendar::OnTouchEvent(Pinetime::Applications::TouchEvents event) { lv_calendar_set_showed_date(calendar, ¤t); return true; } - case TouchEvents::SwipeDown: { + case TouchEvents::SwipeRight: { if (current.month == 1) { current.month = 12; current.year--; From e4a74ee4dc12ea9cff5675911cdbbaeb2750d655 Mon Sep 17 00:00:00 2001 From: thnikk Date: Sat, 16 Apr 2022 20:57:21 -0700 Subject: [PATCH 12/13] Updated statusbar to use formatted time --- src/displayapp/screens/Calendar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 86a85ebe7c..03af89b798 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -9,7 +9,7 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr // Status bar clock and battery label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_fmt(label_time, "%02i:%02i", dateTimeController.Hours(), dateTimeController.Minutes()); + lv_label_set_text_fmt(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0); batteryIcon = lv_label_create(lv_scr_act(), nullptr); From 3a739c62ca6961156e44aefdc182f0fa9f4a2a10 Mon Sep 17 00:00:00 2001 From: thnikk Date: Mon, 18 Apr 2022 20:39:16 -0700 Subject: [PATCH 13/13] Switched to set_text for statusbar instead of set_text_fmt --- src/displayapp/screens/Calendar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/displayapp/screens/Calendar.cpp b/src/displayapp/screens/Calendar.cpp index 03af89b798..b7bbcf5774 100644 --- a/src/displayapp/screens/Calendar.cpp +++ b/src/displayapp/screens/Calendar.cpp @@ -9,7 +9,7 @@ Calendar::Calendar(DisplayApp* app, Pinetime::Controllers::Battery& batteryContr // Status bar clock and battery label_time = lv_label_create(lv_scr_act(), nullptr); - lv_label_set_text_fmt(label_time, dateTimeController.FormattedTime().c_str()); + lv_label_set_text(label_time, dateTimeController.FormattedTime().c_str()); lv_label_set_align(label_time, LV_LABEL_ALIGN_CENTER); lv_obj_align(label_time, lv_scr_act(), LV_ALIGN_IN_TOP_LEFT, 0, 0); batteryIcon = lv_label_create(lv_scr_act(), nullptr);