mod: add clock settings tab, timezone support, and clock size option
Fix clock persistence bug caused by stale legacy read in settings deserialization. Add clock size setting (Small/Medium/Large) and timezone selection with North American presets plus custom UTC offset. Move all clock-related settings into a dedicated Clock tab, rename "Home Screen Clock" to "Clock", and move minute-change detection to main loop so the header clock updates on every screen. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -131,6 +131,22 @@ class CrossPointSettings {
|
||||
// Home screen clock format
|
||||
enum CLOCK_FORMAT { CLOCK_OFF = 0, CLOCK_AMPM = 1, CLOCK_24H = 2, CLOCK_FORMAT_COUNT };
|
||||
|
||||
// Clock size
|
||||
enum CLOCK_SIZE { CLOCK_SIZE_SMALL = 0, CLOCK_SIZE_MEDIUM = 1, CLOCK_SIZE_LARGE = 2, CLOCK_SIZE_COUNT };
|
||||
|
||||
// Timezone presets
|
||||
enum TIMEZONE {
|
||||
TZ_UTC = 0,
|
||||
TZ_EASTERN = 1,
|
||||
TZ_CENTRAL = 2,
|
||||
TZ_MOUNTAIN = 3,
|
||||
TZ_PACIFIC = 4,
|
||||
TZ_ALASKA = 5,
|
||||
TZ_HAWAII = 6,
|
||||
TZ_CUSTOM = 7,
|
||||
TZ_COUNT
|
||||
};
|
||||
|
||||
// Sleep screen settings
|
||||
uint8_t sleepScreen = DARK;
|
||||
// Sleep screen cover mode settings
|
||||
@@ -192,8 +208,15 @@ class CrossPointSettings {
|
||||
uint8_t preferredPortrait = PORTRAIT;
|
||||
uint8_t preferredLandscape = LANDSCAPE_CW;
|
||||
|
||||
// Home screen clock display format (OFF by default)
|
||||
uint8_t homeScreenClock = CLOCK_OFF;
|
||||
// Clock display format (OFF by default)
|
||||
uint8_t clockFormat = CLOCK_OFF;
|
||||
// Clock display size
|
||||
uint8_t clockSize = CLOCK_SIZE_SMALL;
|
||||
|
||||
// Timezone setting
|
||||
uint8_t timezone = TZ_UTC;
|
||||
// Custom timezone offset in hours from UTC (-12 to +14)
|
||||
int8_t timezoneOffsetHours = 0;
|
||||
|
||||
~CrossPointSettings() = default;
|
||||
|
||||
@@ -214,6 +237,7 @@ class CrossPointSettings {
|
||||
float getReaderLineCompression() const;
|
||||
unsigned long getSleepTimeoutMs() const;
|
||||
int getRefreshFrequency() const;
|
||||
const char* getTimezonePosixStr() const;
|
||||
};
|
||||
|
||||
// Helper macro to access settings
|
||||
|
||||
Reference in New Issue
Block a user