Skip to content

Commit 1d25b7b

Browse files
Lionel Elie Mamanedariusarnold
Lionel Elie Mamane
authored andcommitted
Settings; refuse to (fail to) calibrate shake sensitivity while in sleep mode
1 parent 0a7f645 commit 1d25b7b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/displayapp/screens/settings/SettingShakeThreshold.cpp

+16
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,19 @@ SettingShakeThreshold::SettingShakeThreshold(Controllers::Settings& settingsCont
2424
lv_label_set_align(title, LV_LABEL_ALIGN_CENTER);
2525
lv_obj_align(title, lv_scr_act(), LV_ALIGN_IN_TOP_MID, 0, 0);
2626

27+
if (settingsController.GetNotificationStatus() == Controllers::Settings::Notification::Sleep) {
28+
lv_obj_t* explanation = lv_label_create(lv_scr_act(), nullptr);
29+
lv_label_set_long_mode(explanation, LV_LABEL_LONG_BREAK);
30+
lv_label_set_align(explanation, LV_LABEL_ALIGN_AUTO);
31+
lv_obj_set_width(explanation, LV_HOR_RES_MAX);
32+
lv_label_set_text_static(
33+
explanation,
34+
"\nShake detector is disabled in sleep mode, and will neither wake up the watch nor calibrate.\nDisable sleep mode to calibrate.");
35+
calibrating = 255;
36+
lv_obj_align(explanation, title, LV_ALIGN_OUT_BOTTOM_MID, 0, 0);
37+
return;
38+
}
39+
2740
positionArc = lv_arc_create(lv_scr_act(), nullptr);
2841
positionArc->user_data = this;
2942

@@ -72,6 +85,9 @@ SettingShakeThreshold::SettingShakeThreshold(Controllers::Settings& settingsCont
7285
}
7386

7487
SettingShakeThreshold::~SettingShakeThreshold() {
88+
if (calibrating == 255)
89+
return;
90+
7591
settingsController.SetShakeThreshold(lv_arc_get_value(positionArc));
7692

7793
if (EnableForCal) {

0 commit comments

Comments
 (0)