From 20ac7e8df38836d0a72c378b900b99c827c996c2 Mon Sep 17 00:00:00 2001 From: KaffeinatedKat Date: Fri, 29 Sep 2023 21:00:07 -0600 Subject: feat: always on display --- src/components/settings/Settings.h | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'src/components/settings') diff --git a/src/components/settings/Settings.h b/src/components/settings/Settings.h index 06312077..d75cd678 100644 --- a/src/components/settings/Settings.h +++ b/src/components/settings/Settings.h @@ -214,6 +214,17 @@ namespace Pinetime { return settings.screenTimeOut; }; + void SetAlwaysOnDisplay(bool state) { + if (state != settings.alwaysOnDisplay) { + settingsChanged = true; + } + settings.alwaysOnDisplay = state; + }; + + bool GetAlwaysOnDisplay() const { + return settings.alwaysOnDisplay; + }; + void SetShakeThreshold(uint16_t thresh) { if (settings.shakeWakeThreshold != thresh) { settings.shakeWakeThreshold = thresh; @@ -286,13 +297,15 @@ namespace Pinetime { private: Pinetime::Controllers::FS& fs; - static constexpr uint32_t settingsVersion = 0x0007; + static constexpr uint32_t settingsVersion = 0x0008; struct SettingsData { uint32_t version = settingsVersion; uint32_t stepsGoal = 10000; uint32_t screenTimeOut = 15000; + bool alwaysOnDisplay = false; + ClockType clockType = ClockType::H24; WeatherFormat weatherFormat = WeatherFormat::Metric; Notification notificationStatus = Notification::On; -- cgit v1.2.3-70-g09d2