summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Clock.cpp
diff options
context:
space:
mode:
authorJean-François Milants <jf@codingfield.com>2021-06-12 14:21:29 +0200
committerJean-François Milants <jf@codingfield.com>2021-06-12 14:21:29 +0200
commitd7962617e47c221b6274af53b9488e5280c8d2d8 (patch)
treef5963049fc5136cce37eb1e58580b23d9268d1e5 /src/displayapp/screens/Clock.cpp
parent17c65839376e5ad154855ed19f8ea8ae1bc78a9b (diff)
Clock : initialize the actual clockface in initialization list instead of in the core of the ctro().
Diffstat (limited to 'src/displayapp/screens/Clock.cpp')
-rw-r--r--src/displayapp/screens/Clock.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/src/displayapp/screens/Clock.cpp b/src/displayapp/screens/Clock.cpp
index 9962a9f4..05e47a39 100644
--- a/src/displayapp/screens/Clock.cpp
+++ b/src/displayapp/screens/Clock.cpp
@@ -32,25 +32,18 @@ Clock::Clock(DisplayApp* app,
notificatioManager {notificatioManager},
settingsController {settingsController},
heartRateController {heartRateController},
- motionController {motionController} {
-
- switch (settingsController.GetClockFace()) {
- case 0:
- screen = WatchFaceDigitalScreen();
- break;
- case 1:
- screen = WatchFaceAnalogScreen();
- break;
- /*
- // Examples for more watch faces
- case 2:
- screen = WatchFaceMinimalScreen();
- break;
- case 3:
- screen = WatchFaceCustomScreen();
- break;
- */
- }
+ motionController {motionController},
+ screen {[this, &settingsController]() {
+ switch (settingsController.GetClockFace()) {
+ case 0:
+ return WatchFaceDigitalScreen();
+ break;
+ case 1:
+ return WatchFaceAnalogScreen();
+ break;
+ }
+ return WatchFaceDigitalScreen();
+ }()} {
settingsController.SetAppMenu(0);
}