summaryrefslogtreecommitdiff
path: root/src/displayapp
diff options
context:
space:
mode:
authorEivind Mork <eivind@morkcloud.com>2021-04-30 22:55:42 +0200
committerEivind Mork <eivind@morkcloud.com>2021-05-02 12:30:33 +0200
commit3355afbbd197d6225d22a9ee405f2cb0a8376cbf (patch)
tree863830ca041befb5c13efae7f80686616117fb1b /src/displayapp
parenteedff2c06c292bda8dcb92fc04c67097fe72e22f (diff)
Show heartbeat icon in watchface in gray if data is missing
Diffstat (limited to 'src/displayapp')
-rw-r--r--src/displayapp/screens/WatchFaceDigital.cpp17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/displayapp/screens/WatchFaceDigital.cpp b/src/displayapp/screens/WatchFaceDigital.cpp
index bf078d03..f1285eaf 100644
--- a/src/displayapp/screens/WatchFaceDigital.cpp
+++ b/src/displayapp/screens/WatchFaceDigital.cpp
@@ -88,14 +88,9 @@ WatchFaceDigital::WatchFaceDigital(DisplayApp* app,
heartbeatValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(heartbeatValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
- lv_label_set_text(heartbeatValue, "---");
+ lv_label_set_text(heartbeatValue, "");
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
- heartbeatBpm = lv_label_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_text_color(heartbeatBpm, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
- lv_label_set_text(heartbeatBpm, "BPM");
- lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
-
stepValue = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(stepValue, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x00FFE7));
lv_label_set_text(stepValue, "0");
@@ -226,14 +221,16 @@ bool WatchFaceDigital::Refresh() {
heartbeat = heartRateController.HeartRate();
heartbeatRunning = heartRateController.State() != Controllers::HeartRateController::States::Stopped;
if (heartbeat.IsUpdated() || heartbeatRunning.IsUpdated()) {
- if (heartbeatRunning.Get())
+ if (heartbeatRunning.Get()) {
+ lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0xCE1B1B));
lv_label_set_text_fmt(heartbeatValue, "%d", heartbeat.Get());
- else
- lv_label_set_text_static(heartbeatValue, "---");
+ } else {
+ lv_obj_set_style_local_text_color(heartbeatIcon, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x1B1B1B));
+ lv_label_set_text_static(heartbeatValue, "");
+ }
lv_obj_align(heartbeatIcon, lv_scr_act(), LV_ALIGN_IN_BOTTOM_LEFT, 5, -2);
lv_obj_align(heartbeatValue, heartbeatIcon, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
- lv_obj_align(heartbeatBpm, heartbeatValue, LV_ALIGN_OUT_RIGHT_MID, 5, 0);
}
stepCount = motionController.NbSteps();