Skip to content

Commit 4f4f446

Browse files
minacodeNeroBurner
minacode
authored andcommitted
Support refactor watch face to enum
Support for PR: InfiniTimeOrg/InfiniTime#1339
1 parent 512f251 commit 4f4f446

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

InfiniTime

littlefs-do-main.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -535,15 +535,15 @@ int command_settings(const std::string &program_name, const std::vector<std::str
535535
settingsController.Init();
536536
using namespace Pinetime::Controllers;
537537
{
538-
auto clockface = settingsController.GetClockFace();
538+
auto clockface = settingsController.GetWatchFace();
539539
auto clockface_str = [](auto val) {
540-
if (val == 0) return "Digital";
541-
if (val == 1) return "Analog";
542-
if (val == 2) return "PineTimeStyle";
543-
if (val == 3) return "Terminal";
540+
if (val == Pinetime::Applications::WatchFace::Digital) return "Digital";
541+
if (val == Pinetime::Applications::WatchFace::Analog) return "Analog";
542+
if (val == Pinetime::Applications::WatchFace::PineTimeStyle) return "PineTimeStyle";
543+
if (val == Pinetime::Applications::WatchFace::Terminal) return "Terminal";
544544
return "unknown";
545545
}(clockface);
546-
std::cout << "ClockFace: " << static_cast<int>(clockface) << " " << clockface_str << std::endl;
546+
std::cout << "ClockFace: " << static_cast<uint32_t>(clockface) << " " << clockface_str << std::endl;
547547
}
548548
{
549549
auto chimes = settingsController.GetChimeOption();

main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -755,15 +755,15 @@ class Framework {
755755
void switch_to_screen(uint8_t screen_idx)
756756
{
757757
if (screen_idx == 1) {
758-
settingsController.SetClockFace(0);
758+
settingsController.SetWatchFace(Pinetime::Applications::WatchFace::Digital);
759759
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
760760
}
761761
else if (screen_idx == 2) {
762-
settingsController.SetClockFace(1);
762+
settingsController.SetWatchFace(Pinetime::Applications::WatchFace::Analog);
763763
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
764764
}
765765
else if (screen_idx == 3) {
766-
settingsController.SetClockFace(2);
766+
settingsController.SetWatchFace(Pinetime::Applications::WatchFace::PineTimeStyle);
767767
displayApp.StartApp(Pinetime::Applications::Apps::Clock, Pinetime::Applications::DisplayApp::FullRefreshDirections::None);
768768
}
769769
else if (screen_idx == 4) {

0 commit comments

Comments
 (0)