Skip to content

Commit 578f06e

Browse files
committed
Showing wake mode on info screen only when alarm is active.
Also applied code formatting.
1 parent 37351cf commit 578f06e

File tree

2 files changed

+18
-16
lines changed

2 files changed

+18
-16
lines changed

src/displayapp/screens/Sleep.cpp

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -316,22 +316,24 @@ void Sleep::DrawInfoScreen() {
316316
LV_STATE_DEFAULT,
317317
infiniSleepController.IsEnabled() ? LV_COLOR_RED : LV_COLOR_WHITE);
318318

319-
// Gradual Wake info
320-
label_gradual_wake = lv_label_create(lv_scr_act(), nullptr);
321-
if (infiniSleepController.infiniSleepSettings.graddualWake && infiniSleepController.infiniSleepSettings.naturalWake) {
322-
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Both");
323-
} else if (infiniSleepController.infiniSleepSettings.graddualWake) {
324-
lv_label_set_text_static(label_gradual_wake, "Wake Mode: PreWake");
325-
} else if (infiniSleepController.infiniSleepSettings.naturalWake) {
326-
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Natural");
327-
} else {
328-
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Normal");
319+
// Wake Mode info
320+
if (infiniSleepController.GetWakeAlarm().isEnabled) {
321+
label_gradual_wake = lv_label_create(lv_scr_act(), nullptr);
322+
if (infiniSleepController.infiniSleepSettings.graddualWake && infiniSleepController.infiniSleepSettings.naturalWake) {
323+
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Both");
324+
} else if (infiniSleepController.infiniSleepSettings.graddualWake) {
325+
lv_label_set_text_static(label_gradual_wake, "Wake Mode: PreWake");
326+
} else if (infiniSleepController.infiniSleepSettings.naturalWake) {
327+
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Natural");
328+
} else {
329+
lv_label_set_text_static(label_gradual_wake, "Wake Mode: Normal");
330+
}
331+
lv_obj_align(label_gradual_wake, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
332+
lv_obj_set_style_local_text_color(label_gradual_wake,
333+
LV_LABEL_PART_MAIN,
334+
LV_STATE_DEFAULT,
335+
infiniSleepController.IsEnabled() ? LV_COLOR_RED : LV_COLOR_WHITE);
329336
}
330-
lv_obj_align(label_gradual_wake, lv_scr_act(), LV_ALIGN_CENTER, 0, 40);
331-
lv_obj_set_style_local_text_color(label_gradual_wake,
332-
LV_LABEL_PART_MAIN,
333-
LV_STATE_DEFAULT,
334-
infiniSleepController.IsEnabled() ? LV_COLOR_RED : LV_COLOR_WHITE);
335337

336338
// Start/Stop button
337339
trackerToggleBtn = lv_btn_create(lv_scr_act(), nullptr);

src/displayapp/screens/Sleep.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace Pinetime {
3939

4040
bool ignoreButtonPush = false;
4141

42-
lv_obj_t *btnSnooze;
42+
lv_obj_t* btnSnooze;
4343

4444
private:
4545
System::WakeLock wakeLock;

0 commit comments

Comments
 (0)