diff options
| author | Riku Isokoski <riksu9000@gmail.com> | 2021-07-14 06:59:56 (GMT) |
|---|---|---|
| committer | Riku Isokoski <riksu9000@gmail.com> | 2021-07-14 06:59:56 (GMT) |
| commit | 95b8a56dd42da067b56e37111577427518d825fb (patch) | |
| tree | 2a5d20d061f27e510bd7bd4e1af1621ad8a6d4b0 /src/displayapp/screens/Clock.cpp | |
| parent | 239b5547eae64d05f5d7544f0e11bfb877a75a02 (diff) | |
| parent | a07b6382aef3c30d8ea8f28fcc3cc880d7afd747 (diff) | |
Merge branch 'develop' into fix_touchevent_tap
Diffstat (limited to 'src/displayapp/screens/Clock.cpp')
| -rw-r--r-- | src/displayapp/screens/Clock.cpp | 44 |
1 files changed, 27 insertions, 17 deletions
diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp index 1429984..e068497 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; @@ -33,21 +34,20 @@ Clock::Clock(DisplayApp* app, settingsController {settingsController}, heartRateController {heartRateController}, motionController {motionController}, - screens {app, - settingsController.GetClockFace(), - { - [this]() -> std::unique_ptr<Screen> { - return WatchFaceDigitalScreen(); - }, - [this]() -> std::unique_ptr<Screen> { - return WatchFaceAnalogScreen(); - }, - // Examples for more watch faces - //[this]() -> std::unique_ptr<Screen> { return WatchFaceMinimalScreen(); }, - //[this]() -> std::unique_ptr<Screen> { return WatchFaceCustomScreen(); } - }, - Screens::ScreenListModes::LongPress} { - + screen {[this, &settingsController]() { + switch (settingsController.GetClockFace()) { + case 0: + return WatchFaceDigitalScreen(); + break; + case 1: + return WatchFaceAnalogScreen(); + break; + case 2: + return PineTimeStyleScreen(); + break; + } + return WatchFaceDigitalScreen(); + }()} { settingsController.SetAppMenu(0); } @@ -56,12 +56,12 @@ Clock::~Clock() { } bool Clock::Refresh() { - screens.Refresh(); + screen->Refresh(); return running; } bool Clock::OnTouchEvent(Pinetime::Applications::TouchEvents event) { - return screens.OnTouchEvent(event); + return screen->OnTouchEvent(event); } std::unique_ptr<Screen> Clock::WatchFaceDigitalScreen() { @@ -80,6 +80,16 @@ std::unique_ptr<Screen> Clock::WatchFaceAnalogScreen() { app, dateTimeController, batteryController, bleController, notificatioManager, settingsController); } +std::unique_ptr<Screen> Clock::PineTimeStyleScreen() { + return std::make_unique<Screens::PineTimeStyle>(app, + dateTimeController, + batteryController, + bleController, + notificatioManager, + settingsController, + motionController); +} + /* // Examples for more watch faces std::unique_ptr<Screen> Clock::WatchFaceMinimalScreen() { |
