diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 077546a0..b233f926 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -456,7 +456,7 @@ list(APPEND SOURCE_FILES displayapp/screens/WatchFaceAnalog.cpp displayapp/screens/WatchFaceDigital.cpp displayapp/screens/WatchFaceTerminal.cpp - displayapp/screens/PineTimeStyle.cpp + displayapp/screens/WatchFacePineTimeStyle.cpp ## diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index fd74683a..693e42a9 100644 --- a/src/displayapp/screens/Clock.cpp +++ b/src/displayapp/screens/Clock.cpp @@ -11,7 +11,7 @@ #include "displayapp/screens/WatchFaceDigital.h" #include "displayapp/screens/WatchFaceTerminal.h" #include "displayapp/screens/WatchFaceAnalog.h" -#include "displayapp/screens/PineTimeStyle.h" +#include "displayapp/screens/WatchFacePineTimeStyle.h" using namespace Pinetime::Applications::Screens; @@ -40,7 +40,7 @@ Clock::Clock(DisplayApp* app, return WatchFaceAnalogScreen(); break; case 2: - return PineTimeStyleScreen(); + return WatchFacePineTimeStyleScreen(); break; case 3: return WatchFaceTerminalScreen(); @@ -79,8 +79,8 @@ std::unique_ptr Clock::WatchFaceAnalogScreen() { app, dateTimeController, batteryController, bleController, notificatioManager, settingsController); } -std::unique_ptr Clock::PineTimeStyleScreen() { - return std::make_unique( +std::unique_ptr Clock::WatchFacePineTimeStyleScreen() { + return std::make_unique( app, dateTimeController, batteryController, bleController, notificatioManager, settingsController, motionController); } diff --git a/src/displayapp/screens/Clock.h b/src/displayapp/screens/Clock.h index 50996a73..1ba752c7 100644 --- a/src/displayapp/screens/Clock.h +++ b/src/displayapp/screens/Clock.h @@ -46,7 +46,7 @@ namespace Pinetime { std::unique_ptr screen; std::unique_ptr WatchFaceDigitalScreen(); std::unique_ptr WatchFaceAnalogScreen(); - std::unique_ptr PineTimeStyleScreen(); + std::unique_ptr WatchFacePineTimeStyleScreen(); std::unique_ptr WatchFaceTerminalScreen(); }; } diff --git a/src/displayapp/screens/PineTimeStyle.cpp b/src/displayapp/screens/WatchFacePineTimeStyle.cpp similarity index 96% rename from src/displayapp/screens/PineTimeStyle.cpp rename to src/displayapp/screens/WatchFacePineTimeStyle.cpp index e807289c..d0fbf059 100644 --- a/src/displayapp/screens/PineTimeStyle.cpp +++ b/src/displayapp/screens/WatchFacePineTimeStyle.cpp @@ -19,7 +19,7 @@ * Style/layout copied from TimeStyle for Pebble by Dan Tilden (github.com/tilden) */ -#include "displayapp/screens/PineTimeStyle.h" +#include "displayapp/screens/WatchFacePineTimeStyle.h" #include #include #include @@ -39,7 +39,7 @@ using namespace Pinetime::Applications::Screens; namespace { void event_handler(lv_obj_t* obj, lv_event_t event) { - auto* screen = static_cast(obj->user_data); + auto* screen = static_cast(obj->user_data); screen->UpdateSelected(obj, event); } @@ -51,7 +51,7 @@ namespace { } } -PineTimeStyle::PineTimeStyle(DisplayApp* app, +WatchFacePineTimeStyle::WatchFacePineTimeStyle(DisplayApp* app, Controllers::DateTime& dateTimeController, Controllers::Battery& batteryController, Controllers::Ble& bleController, @@ -300,12 +300,12 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app, Refresh(); } -PineTimeStyle::~PineTimeStyle() { +WatchFacePineTimeStyle::~WatchFacePineTimeStyle() { lv_task_del(taskRefresh); lv_obj_clean(lv_scr_act()); } -bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { +bool WatchFacePineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { if ((event == Pinetime::Applications::TouchEvents::LongTap) && lv_obj_get_hidden(btnRandom)) { lv_obj_set_hidden(btnSet, false); savedTick = lv_tick_get(); @@ -317,7 +317,7 @@ bool PineTimeStyle::OnTouchEvent(Pinetime::Applications::TouchEvents event) { return false; } -void PineTimeStyle::CloseMenu() { +void WatchFacePineTimeStyle::CloseMenu() { settingsController.SaveSettings(); lv_obj_set_hidden(btnNextTime, true); lv_obj_set_hidden(btnPrevTime, true); @@ -330,7 +330,7 @@ void PineTimeStyle::CloseMenu() { lv_obj_set_hidden(btnClose, true); } -bool PineTimeStyle::OnButtonPushed() { +bool WatchFacePineTimeStyle::OnButtonPushed() { if (!lv_obj_get_hidden(btnClose)) { CloseMenu(); return true; @@ -338,13 +338,12 @@ bool PineTimeStyle::OnButtonPushed() { return false; } -void PineTimeStyle::SetBatteryIcon() { +void WatchFacePineTimeStyle::SetBatteryIcon() { auto batteryPercent = batteryPercentRemaining.Get(); lv_label_set_text_static(batteryIcon, BatteryIcon::GetBatteryIcon(batteryPercent)); } - -void PineTimeStyle::AlignIcons() { +void WatchFacePineTimeStyle::AlignIcons() { if (notificationState.Get() && bleState.Get()) { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); lv_obj_align(notificationIcon, sidebar, LV_ALIGN_IN_TOP_MID, -8, 25); @@ -355,7 +354,7 @@ void PineTimeStyle::AlignIcons() { } } -void PineTimeStyle::Refresh() { +void WatchFacePineTimeStyle::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { @@ -455,7 +454,7 @@ void PineTimeStyle::Refresh() { } } -void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) { +void WatchFacePineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) { auto valueTime = settingsController.GetPTSColorTime(); auto valueBar = settingsController.GetPTSColorBar(); auto valueBG = settingsController.GetPTSColorBG(); @@ -576,7 +575,7 @@ void PineTimeStyle::UpdateSelected(lv_obj_t* object, lv_event_t event) { } } -Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) { +Pinetime::Controllers::Settings::Colors WatchFacePineTimeStyle::GetNext(Pinetime::Controllers::Settings::Colors color) { auto colorAsInt = static_cast(color); Pinetime::Controllers::Settings::Colors nextColor; if (colorAsInt < 16) { @@ -587,7 +586,7 @@ Pinetime::Controllers::Settings::Colors PineTimeStyle::GetNext(Pinetime::Control return nextColor; } -Pinetime::Controllers::Settings::Colors PineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) { +Pinetime::Controllers::Settings::Colors WatchFacePineTimeStyle::GetPrevious(Pinetime::Controllers::Settings::Colors color) { auto colorAsInt = static_cast(color); Pinetime::Controllers::Settings::Colors prevColor; diff --git a/src/displayapp/screens/PineTimeStyle.h b/src/displayapp/screens/WatchFacePineTimeStyle.h similarity index 96% rename from src/displayapp/screens/PineTimeStyle.h rename to src/displayapp/screens/WatchFacePineTimeStyle.h index 5de9a5fa..465aa705 100644 --- a/src/displayapp/screens/PineTimeStyle.h +++ b/src/displayapp/screens/WatchFacePineTimeStyle.h @@ -21,16 +21,16 @@ namespace Pinetime { namespace Applications { namespace Screens { - class PineTimeStyle : public Screen { + class WatchFacePineTimeStyle : public Screen { public: - PineTimeStyle(DisplayApp* app, + WatchFacePineTimeStyle(DisplayApp* app, Controllers::DateTime& dateTimeController, Controllers::Battery& batteryController, Controllers::Ble& bleController, Controllers::NotificationManager& notificatioManager, Controllers::Settings& settingsController, Controllers::MotionController& motionController); - ~PineTimeStyle() override; + ~WatchFacePineTimeStyle() override; bool OnTouchEvent(TouchEvents event) override; bool OnButtonPushed() override;