Refactor watch face to enum (#1339)

change watch face from int to enum

---------

Co-authored-by: minacode <minamoto9@web.de>
This commit is contained in:
Max Friedrich
2023-04-30 17:03:46 +02:00
committed by GitHub
parent 5f19f689f9
commit 020a7fd11d
5 changed files with 34 additions and 16 deletions

View File

@@ -15,6 +15,7 @@
#include "displayapp/screens/WatchFaceCasioStyleG7710.h"
using namespace Pinetime::Applications::Screens;
using namespace Pinetime::Applications;
Clock::Clock(Controllers::DateTime& dateTimeController,
const Controllers::Battery& batteryController,
@@ -33,23 +34,23 @@ Clock::Clock(Controllers::DateTime& dateTimeController,
motionController {motionController},
filesystem {filesystem},
screen {[this, &settingsController]() {
switch (settingsController.GetClockFace()) {
case 0:
switch (settingsController.GetWatchFace()) {
case WatchFace::Digital:
return WatchFaceDigitalScreen();
break;
case 1:
case WatchFace::Analog:
return WatchFaceAnalogScreen();
break;
case 2:
case WatchFace::PineTimeStyle:
return WatchFacePineTimeStyleScreen();
break;
case 3:
case WatchFace::Terminal:
return WatchFaceTerminalScreen();
break;
case 4:
case WatchFace::Infineat:
return WatchFaceInfineatScreen();
break;
case 5:
case WatchFace::CasioStyleG7710:
return WatchFaceCasioStyleG7710();
break;
}