diff options
Diffstat (limited to 'src/components')
-rw-r--r-- | src/components/datetime/DateTimeController.cpp | 5 | ||||
-rw-r--r-- | src/components/datetime/DateTimeController.h | 1 | ||||
-rw-r--r-- | src/components/settings/Settings.h | 37 |
3 files changed, 42 insertions, 1 deletions
diff --git a/src/components/datetime/DateTimeController.cpp b/src/components/datetime/DateTimeController.cpp index ba04705f..4dc16329 100644 --- a/src/components/datetime/DateTimeController.cpp +++ b/src/components/datetime/DateTimeController.cpp @@ -7,6 +7,7 @@ using namespace Pinetime::Controllers; namespace { char const* DaysStringShort[] = {"--", "MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"}; + char const* DaysStringShortLow[] = {"--", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; char const* MonthsString[] = {"--", "JAN", "FEB", "MAR", "APR", "MAY", "JUN", "JUL", "AUG", "SEP", "OCT", "NOV", "DEC"}; char const* MonthsStringLow[] = {"--", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"}; } @@ -126,6 +127,10 @@ const char* DateTime::MonthShortToStringLow(Months month) { return MonthsStringLow[static_cast<uint8_t>(month)]; } +const char* DateTime::DayOfWeekShortToStringLow() const { + return DaysStringShortLow[static_cast<uint8_t>(dayOfWeek)]; +} + void DateTime::Register(Pinetime::System::SystemTask* systemTask) { this->systemTask = systemTask; } diff --git a/src/components/datetime/DateTimeController.h b/src/components/datetime/DateTimeController.h index 00bbc2ee..81319d15 100644 --- a/src/components/datetime/DateTimeController.h +++ b/src/components/datetime/DateTimeController.h @@ -64,6 +64,7 @@ namespace Pinetime { const char* MonthShortToString() const; const char* DayOfWeekShortToString() const; static const char* MonthShortToStringLow(Months month); + const char* DayOfWeekShortToStringLow() const; std::chrono::time_point<std::chrono::system_clock, std::chrono::nanoseconds> CurrentDateTime() const { return currentDateTime; diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 478408f6..8a246d11 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -41,6 +41,10 @@ namespace Pinetime { Colors ColorBar = Colors::Teal; Colors ColorBG = Colors::Black; }; + struct WatchFaceInfineat { + bool showSideCover = true; + int colorIndex = 0; + }; Settings(Pinetime::Controllers::FS& fs); @@ -94,6 +98,26 @@ namespace Pinetime { return settings.PTS.ColorBG; }; + void SetInfineatShowSideCover(bool show) { + if (show != settings.watchFaceInfineat.showSideCover) { + settings.watchFaceInfineat.showSideCover = show; + settingsChanged = true; + } + }; + bool GetInfineatShowSideCover() const { + return settings.watchFaceInfineat.showSideCover; + }; + + void SetInfineatColorIndex(int index) { + if (index != settings.watchFaceInfineat.colorIndex) { + settings.watchFaceInfineat.colorIndex = index; + settingsChanged = true; + } + }; + int GetInfineatColorIndex() const { + return settings.watchFaceInfineat.colorIndex; + }; + void SetAppMenu(uint8_t menu) { appMenu = menu; }; @@ -109,6 +133,14 @@ namespace Pinetime { return settingsMenu; }; + void SetWatchfacesMenu(uint8_t menu) { + watchFacesMenu = menu; + }; + + uint8_t GetWatchfacesMenu() const { + return watchFacesMenu; + }; + void SetClockType(ClockType clocktype) { if (clocktype != settings.clockType) { settingsChanged = true; @@ -212,7 +244,7 @@ namespace Pinetime { private: Pinetime::Controllers::FS& fs; - static constexpr uint32_t settingsVersion = 0x0003; + static constexpr uint32_t settingsVersion = 0x0004; struct SettingsData { uint32_t version = settingsVersion; uint32_t stepsGoal = 10000; @@ -226,6 +258,8 @@ namespace Pinetime { PineTimeStyle PTS; + WatchFaceInfineat watchFaceInfineat; + std::bitset<4> wakeUpMode {0}; uint16_t shakeWakeThreshold = 150; Controllers::BrightnessController::Levels brightLevel = Controllers::BrightnessController::Levels::Medium; @@ -236,6 +270,7 @@ namespace Pinetime { uint8_t appMenu = 0; uint8_t settingsMenu = 0; + uint8_t watchFacesMenu = 0; /* ble state is intentionally not saved with the other watch settings and initialized * to off (false) on every boot because we always want ble to be enabled on startup */ |