diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index acbfba18..5b83812d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -421,6 +421,7 @@ list(APPEND SOURCE_FILES displayapp/icons/bg_clock.c displayapp/screens/WatchFaceAnalog.cpp displayapp/screens/WatchFaceDigital.cpp + displayapp/screens/PineTimeStyle.cpp ## @@ -470,6 +471,7 @@ list(APPEND SOURCE_FILES displayapp/fonts/jetbrains_mono_76.c displayapp/fonts/jetbrains_mono_42.c displayapp/fonts/lv_font_sys_48.c + displayapp/fonts/open_sans_light.c displayapp/lv_pinetime_theme.c systemtask/SystemTask.cpp diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 14299840..e0c1f62b 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -14,6 +14,7 @@ #include "../DisplayApp.h" #include "WatchFaceDigital.h" #include "WatchFaceAnalog.h" +#include "PineTimeStyle.h" using namespace Pinetime::Applications::Screens; @@ -42,6 +43,9 @@ Clock::Clock(DisplayApp* app, [this]() -> std::unique_ptr { return WatchFaceAnalogScreen(); }, + [this]() -> std::unique_ptr { + return PineTimeStyleScreen(); + }, // Examples for more watch faces //[this]() -> std::unique_ptr { return WatchFaceMinimalScreen(); }, //[this]() -> std::unique_ptr { return WatchFaceCustomScreen(); } @@ -80,6 +84,16 @@ std::unique_ptr Clock::WatchFaceAnalogScreen() { app, dateTimeController, batteryController, bleController, notificatioManager, settingsController); } +std::unique_ptr Clock::PineTimeStyleScreen() { + return std::make_unique(app, + dateTimeController, + batteryController, + bleController, + notificatioManager, + settingsController, + heartRateController); +} + /* // Examples for more watch faces std::unique_ptr Clock::WatchFaceMinimalScreen() { @@ -91,4 +105,4 @@ std::unique_ptr Clock::WatchFaceCustomScreen() { return std::make_unique(app, dateTimeController, batteryController, bleController, notificatioManager, settingsController); } -*/ \ No newline at end of file +*/ diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 9879985f..920d58bb 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -47,9 +47,10 @@ namespace Pinetime { Controllers::HeartRateController& heartRateController; Controllers::MotionController& motionController; - ScreenList<2> screens; + ScreenList<3> screens; std::unique_ptr WatchFaceDigitalScreen(); std::unique_ptr WatchFaceAnalogScreen(); + std::unique_ptr PineTimeStyleScreen(); // Examples for more watch faces // std::unique_ptr WatchFaceMinimalScreen(); diff --git a/src/displayapp/screens/settings/SettingWatchFace.cpp b/src/displayapp/screens/settings/SettingWatchFace.cpp index 457cebf6..33d41416 100644 --- a/src/displayapp/screens/settings/SettingWatchFace.cpp +++ b/src/displayapp/screens/settings/SettingWatchFace.cpp @@ -58,6 +58,15 @@ SettingWatchFace::SettingWatchFace(Pinetime::Applications::DisplayApp* app, Pine lv_checkbox_set_checked(cbOption[optionsTotal], true); } + optionsTotal++; + cbOption[optionsTotal] = lv_checkbox_create(container1, nullptr); + lv_checkbox_set_text_static(cbOption[optionsTotal], " PineTimeStyle"); + cbOption[optionsTotal]->user_data = this; + lv_obj_set_event_cb(cbOption[optionsTotal], event_handler); + if (settingsController.GetClockFace() == 2) { + lv_checkbox_set_checked(cbOption[optionsTotal], true); + } + optionsTotal++; } @@ -81,4 +90,4 @@ void SettingWatchFace::UpdateSelected(lv_obj_t* object, lv_event_t event) { } } } -} \ No newline at end of file +} diff --git a/src/libs/lv_conf.h b/src/libs/lv_conf.h index 761baba2..cabc1859 100644 --- a/src/libs/lv_conf.h +++ b/src/libs/lv_conf.h @@ -417,6 +417,7 @@ typedef void* lv_indev_drv_user_data_t; /*Type of user data in the in LV_FONT_DECLARE(jetbrains_mono_extrabold_compressed) \ LV_FONT_DECLARE(jetbrains_mono_42) \ LV_FONT_DECLARE(jetbrains_mono_76) \ + LV_FONT_DECLARE(open_sans_light) \ LV_FONT_DECLARE(lv_font_sys_48) /* Enable it if you have fonts with a lot of characters. @@ -758,4 +759,4 @@ typedef void* lv_obj_user_data_t; /*--END OF LV_CONF_H--*/ -#endif /*LV_CONF_H*/ \ No newline at end of file +#endif /*LV_CONF_H*/