Skip to content

feat(settings): add 12-hour clock option for the top bar - #250

Open
dianjixz wants to merge 2 commits into
masterfrom
feat/settings-12h-clock
Open

dianjixz wants to merge 2 commits into
masterfrom
feat/settings-12h-clock

Conversation

@dianjixz

Copy link
Copy Markdown
Collaborator

Add a "12H Clock" toggle under Date & Time in the APPLaunch settings tree, backed by the shared CP0_CONFIG_KEY_CLOCK_12H config key so the setting and its presentation cannot drift apart. The preference is read with GetInt, written with SetInt plus Save, and rolled back when Save fails.

cp0_time_str() keeps its documented 24-hour "HH:MM" contract because the Date & Time page parses that value. A new cp0::time::format_12_hour() helper only reformats the presentation to "h:MM AM/PM", and the top bar pill switches to a wider background asset to fit the longer text.

Add unit tests for the formatter and contract tests for the setting, the shared config key, the persistence rollback, and the wide pill asset.

Add a "12H Clock" toggle under Date & Time in the APPLaunch settings tree,
backed by the shared CP0_CONFIG_KEY_CLOCK_12H config key so the setting and
its presentation cannot drift apart. The preference is read with GetInt,
written with SetInt plus Save, and rolled back when Save fails.

cp0_time_str() keeps its documented 24-hour "HH:MM" contract because the
Date & Time page parses that value. A new cp0::time::format_12_hour()
helper only reformats the presentation to "h:MM AM/PM", and the top bar
pill switches to a wider background asset to fit the longer text.

Add unit tests for the formatter and contract tests for the setting, the
shared config key, the persistence rollback, and the wide pill asset.
- Point APPLaunch SSH deploy host to the new device IP
- Use {password}/{remote_file_path} placeholders in deploy after_cmd
- Add cp0_time_format.cpp to CardputerZero-Emulator sources
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant