From ea14c580ca6296cb93facf526d65a2db0e3ff1b0 Mon Sep 17 00:00:00 2001 From: mabuch Date: Sat, 12 Mar 2022 17:55:54 +0100 Subject: [PATCH] Rename PineTimeStyle to WatchFacePineTimeStyle --- src/CMakeLists.txt | 2 +- src/displayapp/screens/Clock.cpp | 8 +++--- src/displayapp/screens/Clock.h | 2 +- ...meStyle.cpp => WatchFacePineTimeStyle.cpp} | 26 +++++++++---------- ...neTimeStyle.h => WatchFacePineTimeStyle.h} | 6 ++--- 5 files changed, 22 insertions(+), 22 deletions(-) rename src/displayapp/screens/{PineTimeStyle.cpp => WatchFacePineTimeStyle.cpp} (96%) rename src/displayapp/screens/{PineTimeStyle.h => WatchFacePineTimeStyle.h} (96%) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index ff0c9b0c..2f7df3a1 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 44bf47a4..e032ac2e 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,13 @@ 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() { bool isBleIconVisible = IsBleIconVisible(bleRadioEnabled.Get(), bleState.Get()); if (notificationState.Get() && isBleIconVisible) { lv_obj_align(bleIcon, sidebar, LV_ALIGN_IN_TOP_MID, 8, 25); @@ -356,7 +356,7 @@ void PineTimeStyle::AlignIcons() { } } -void PineTimeStyle::Refresh() { +void WatchFacePineTimeStyle::Refresh() { isCharging = batteryController.IsCharging(); if (isCharging.IsUpdated()) { if (isCharging.Get()) { @@ -456,7 +456,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(); @@ -577,7 +577,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) { @@ -588,7 +588,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;