Skip to content

Commit d796261

Browse files
committed
Clock : initialize the actual clockface in initialization list instead of in the core of the ctro().
1 parent 17c6583 commit d796261

1 file changed

Lines changed: 12 additions & 19 deletions

File tree

src/displayapp/screens/Clock.cpp

Lines changed: 12 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -32,25 +32,18 @@ Clock::Clock(DisplayApp* app,
3232
notificatioManager {notificatioManager},
3333
settingsController {settingsController},
3434
heartRateController {heartRateController},
35-
motionController {motionController} {
36-
37-
switch (settingsController.GetClockFace()) {
38-
case 0:
39-
screen = WatchFaceDigitalScreen();
40-
break;
41-
case 1:
42-
screen = WatchFaceAnalogScreen();
43-
break;
44-
/*
45-
// Examples for more watch faces
46-
case 2:
47-
screen = WatchFaceMinimalScreen();
48-
break;
49-
case 3:
50-
screen = WatchFaceCustomScreen();
51-
break;
52-
*/
53-
}
35+
motionController {motionController},
36+
screen {[this, &settingsController]() {
37+
switch (settingsController.GetClockFace()) {
38+
case 0:
39+
return WatchFaceDigitalScreen();
40+
break;
41+
case 1:
42+
return WatchFaceAnalogScreen();
43+
break;
44+
}
45+
return WatchFaceDigitalScreen();
46+
}()} {
5447
settingsController.SetAppMenu(0);
5548
}
5649

0 commit comments

Comments
 (0)