Support refactor watch face to enum

Support for PR: https://github.com/InfiniTimeOrg/InfiniTime/pull/1339
This commit is contained in:
minacode 2022-12-07 14:23:17 +01:00 committed by Reinhold Gschweicher
parent 512f25157b
commit 4f4f446517
3 changed files with 10 additions and 10 deletions

@ -1 +1 @@
Subproject commit 40f7e1c7be6882e01058b5ccf64d5005c6105346 Subproject commit 020a7fd11d1b18fd7ac29ccc00b9c6f6e0cdb17b

View File

@ -535,15 +535,15 @@ int command_settings(const std::string &program_name, const std::vector<std::str
settingsController.Init(); settingsController.Init();
using namespace Pinetime::Controllers; using namespace Pinetime::Controllers;
{ {
auto clockface = settingsController.GetClockFace(); auto clockface = settingsController.GetWatchFace();
auto clockface_str = [](auto val) { auto clockface_str = [](auto val) {
if (val == 0) return "Digital"; if (val == Pinetime::Applications::WatchFace::Digital) return "Digital";
if (val == 1) return "Analog"; if (val == Pinetime::Applications::WatchFace::Analog) return "Analog";
if (val == 2) return "PineTimeStyle"; if (val == Pinetime::Applications::WatchFace::PineTimeStyle) return "PineTimeStyle";
if (val == 3) return "Terminal"; if (val == Pinetime::Applications::WatchFace::Terminal) return "Terminal";
return "unknown"; return "unknown";
}(clockface); }(clockface);
std::cout << "ClockFace: " << static_cast<int>(clockface) << " " << clockface_str << std::endl; std::cout << "ClockFace: " << static_cast<uint32_t>(clockface) << " " << clockface_str << std::endl;
} }
{ {
auto chimes = settingsController.GetChimeOption(); auto chimes = settingsController.GetChimeOption();

View File

@ -755,15 +755,15 @@ public:
void switch_to_screen(uint8_t screen_idx) void switch_to_screen(uint8_t screen_idx)
{ {
if (screen_idx == 1) { if (screen_idx == 1) {
settingsController.SetClockFace(0); settingsController.SetWatchFace(Pinetime::Applications::WatchFace::Digital);
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None); displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
} }
else if (screen_idx == 2) { else if (screen_idx == 2) {
settingsController.SetClockFace(1); settingsController.SetWatchFace(Pinetime::Applications::WatchFace::Analog);
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None); displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
} }
else if (screen_idx == 3) { else if (screen_idx == 3) {
settingsController.SetClockFace(2); settingsController.SetWatchFace(Pinetime::Applications::WatchFace::PineTimeStyle);
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None); displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
} }
else if (screen_idx == 4) { else if (screen_idx == 4) {