Skip to content

Commit

Permalink
Disabled settings while alarm is active.
Browse files Browse the repository at this point in the history
Dif this to avoid weird behavior that can happen if changed during alarm active state. This also remove the need to handle those in code.
  • Loading branch information
cyberneel committed Dec 6, 2024
1 parent b8d27b9 commit 8d2e5f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/displayapp/screens/Sleep.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,14 @@ void Sleep::DrawSettingsScreen() {
// lv_label_set_text_static(lblSettings, "Settings");
// lv_obj_align(lblSettings, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 10);

if (infiniSleepController.wakeAlarm.isEnabled) {
lv_obj_t* lblWarning = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text_static(lblWarning, "Disable alarm to\nchange settings.");
lv_obj_align(lblWarning, lv_scr_act(), LV_ALIGN_CENTER, 0, 0);
lv_obj_set_style_local_text_color(lblWarning, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_RED);
return;
}

int y_offset = 10;

lv_obj_t* lblWakeMode = lv_label_create(lv_scr_act(), nullptr);
Expand Down

0 comments on commit 8d2e5f5

Please sign in to comment.