summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
authorMichele Bini <michele.bini@gmail.com>2022-04-09 16:47:37 (GMT)
committerMichele Bini <michele.bini@gmail.com>2022-04-09 16:49:44 (GMT)
commit42d0d1ad338c55ca44f7f4cbb880c40e293b0d5c (patch)
treed580a2d098d2a96f565d48ac1fcd90e59d34b5eb /src/displayapp/screens
parent4d9c76afdacddb1f766c74789f49f3dc96aead9a (diff)
Integrate FintasticMan's RaiseWake and LowerToSleep mods
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/Motion.cpp8
-rw-r--r--src/displayapp/screens/Motion.h1
-rw-r--r--src/displayapp/screens/settings/SettingWakeUp.cpp12
3 files changed, 19 insertions, 2 deletions
diff --git a/src/displayapp/screens/Motion.cpp b/src/displayapp/screens/Motion.cpp
index 23eb276..77b6518 100644
--- a/src/displayapp/screens/Motion.cpp
+++ b/src/displayapp/screens/Motion.cpp
@@ -37,6 +37,11 @@ Motion::Motion(Pinetime::Applications::DisplayApp* app, Controllers::MotionContr
lv_obj_align(labelStep, chart, LV_ALIGN_IN_BOTTOM_LEFT, 0, 0);
lv_label_set_text(labelStep, "Steps ---");
+ labelLastY = lv_label_create(lv_scr_act(), NULL);
+ lv_label_set_text(labelLastY, "LastY 0");
+ lv_label_set_align(labelLastY, LV_LABEL_ALIGN_RIGHT);
+ lv_obj_align(labelLastY, chart, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
+
taskRefresh = lv_task_create(RefreshTaskCallback, LV_DISP_DEF_REFR_PERIOD, LV_TASK_PRIO_MID, this);
}
@@ -58,4 +63,7 @@ void Motion::Refresh() {
motionController.Y() / 0x10,
motionController.Z() / 0x10);
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 10);
+
+ lv_label_set_text_fmt(labelLastY, "LastY %d", motionController.LastY() / 0x10);
+ lv_obj_align(labelLastY, chart, LV_ALIGN_IN_BOTTOM_RIGHT, 0, 0);
}
diff --git a/src/displayapp/screens/Motion.h b/src/displayapp/screens/Motion.h
index 4d2bd4f..315660c 100644
--- a/src/displayapp/screens/Motion.h
+++ b/src/displayapp/screens/Motion.h
@@ -27,6 +27,7 @@ namespace Pinetime {
lv_obj_t* label;
lv_obj_t* labelStep;
+ lv_obj_t* labelLastY;
lv_task_t* taskRefresh;
};
}
diff --git a/src/displayapp/screens/settings/SettingWakeUp.cpp b/src/displayapp/screens/settings/SettingWakeUp.cpp
index e1b6e36..4fc0994 100644
--- a/src/displayapp/screens/settings/SettingWakeUp.cpp
+++ b/src/displayapp/screens/settings/SettingWakeUp.cpp
@@ -24,9 +24,9 @@ SettingWakeUp::SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::
lv_obj_set_style_local_pad_inner(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 5);
lv_obj_set_style_local_border_width(container1, LV_CONT_PART_MAIN, LV_STATE_DEFAULT, 0);
- lv_obj_set_pos(container1, 10, 60);
+ lv_obj_set_pos(container1, 10, 35);
lv_obj_set_width(container1, LV_HOR_RES - 20);
- lv_obj_set_height(container1, LV_VER_RES - 50);
+ lv_obj_set_height(container1, LV_VER_RES - 20);
lv_cont_set_layout(container1, LV_LAYOUT_COLUMN_LEFT);
lv_obj_t* title = lv_label_create(lv_scr_act(), nullptr);
@@ -73,6 +73,14 @@ SettingWakeUp::SettingWakeUp(Pinetime::Applications::DisplayApp* app, Pinetime::
lv_checkbox_set_checked(cbOption[optionsTotal], true);
}
optionsTotal++;
+ cbOption[optionsTotal] = lv_checkbox_create(container1, nullptr);
+ lv_checkbox_set_text_static(cbOption[optionsTotal], " Lower Wrist");
+ cbOption[optionsTotal]->user_data = this;
+ lv_obj_set_event_cb(cbOption[optionsTotal], event_handler);
+ if (settingsController.isWakeUpModeOn(Pinetime::Controllers::Settings::WakeUpMode::LowerWrist)) {
+ lv_checkbox_set_checked(cbOption[optionsTotal], true);
+ }
+ optionsTotal++;
}
SettingWakeUp::~SettingWakeUp() {