fixed that label ampm stays shown when alarm status is hidden

This commit is contained in:
ecarlett 2024-05-29 12:08:25 +02:00 committed by Eve C
parent 194b061e19
commit e8a1b12e17
6 changed files with 24 additions and 0 deletions

View file

@ -0,0 +1,22 @@
# [InfiniTime : show alarm status on infineat watchface](https://github.com/Eve1374/InfiniTime/tree/alarm-status-on-infineat)
- I forked from [InfiniTime](https://github.com/InfiniTimeOrg/InfiniTime) and added a branch alarm-status-on-infineat
- I modified the watchface settings to have the possibility to show alarm status on watchface
Here are pictures with alarm set in 12 and 24hrs format :
![alarm set and shown, 12hrs format](infineat_alarm_set_12hrs.png "alarm set and shown, 12hrs format")
![alarm set and shown, 24hrs format](infineat_alarm_set_24hrs.png "alarm set and shown, 24hrs format")
Alarm not set :
![alarm shown and not set](infineat_alarm_notset.png "alarm shown and not set")
Settings view :
![settings](infineat_settings.png "settings modified with a button to turn on or off alarm display")
## Possible further development :
- Move this setting to the Alarm app and include alarm display in all watchfaces ?

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

View file

@ -257,6 +257,7 @@ WatchFaceInfineat::WatchFaceInfineat(Controllers::DateTime& dateTimeController,
if (!settingsController.GetInfineatShowAlarmStatus()) {
lv_obj_set_hidden(labelAlarm, true);
lv_obj_set_hidden(alarmIcon, true);
lv_obj_set_hidden(labelTimeAmPmAlarm, true);
}
stepValue = lv_label_create(lv_scr_act(), nullptr);
@ -417,6 +418,7 @@ void WatchFaceInfineat::UpdateSelected(lv_obj_t* object, lv_event_t event) {
bool newShowAlarmStatus = settingsController.GetInfineatShowAlarmStatus();
lv_obj_set_hidden(labelAlarm, !newShowAlarmStatus);
lv_obj_set_hidden(alarmIcon, !newShowAlarmStatus);
lv_obj_set_hidden(labelTimeAmPmAlarm, !newShowAlarmStatus);
const char* labelToggleAlarm = newShowAlarmStatus ? Symbols::bell : Symbols::notbell;
lv_label_set_text_static(lblAlarm, labelToggleAlarm);
}