mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 10:46:12 +00:00
feat: add 12h/24h clock format setting (default 24h)
Toggle in Settings > Display > Format. In 12h mode the clock shows h:mm AM/PM (or h:mm:ss AM/PM with seconds, no space before AM/PM). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
e0312c2b6b
commit
38cd0fada3
@@ -13,6 +13,7 @@ class SettingsScreen : public UIScreen {
|
||||
AUTO_LOCK,
|
||||
BATT_DISPLAY,
|
||||
CLOCK_SECONDS,
|
||||
CLOCK_FORMAT,
|
||||
// Sound section
|
||||
SECTION_SOUND,
|
||||
BUZZER,
|
||||
@@ -311,6 +312,10 @@ class SettingsScreen : public UIScreen {
|
||||
display.print("Seconds");
|
||||
display.setCursor(VAL_X, y);
|
||||
display.print((p && p->clock_hide_seconds) ? "OFF" : "ON");
|
||||
} else if (item == CLOCK_FORMAT) {
|
||||
display.print("Format");
|
||||
display.setCursor(VAL_X, y);
|
||||
display.print((p && p->clock_12h) ? "12h" : "24h");
|
||||
} else if (item == DM_FILTER) {
|
||||
display.print("DM");
|
||||
display.setCursor(VAL_X, y);
|
||||
@@ -496,6 +501,11 @@ public:
|
||||
_dirty = true;
|
||||
return true;
|
||||
}
|
||||
if (_selected == CLOCK_FORMAT && p && (left || right || enter)) {
|
||||
p->clock_12h ^= 1;
|
||||
_dirty = true;
|
||||
return true;
|
||||
}
|
||||
if (_selected == DM_FILTER && p && (left || right || enter)) {
|
||||
p->dm_show_all = p->dm_show_all ? 0 : 1;
|
||||
_dirty = true;
|
||||
|
||||
Reference in New Issue
Block a user