diff options
author | JF002 <JF002@users.noreply.github.com> | 2021-05-02 14:41:19 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-02 14:41:19 +0200 |
commit | 65e4fe0310c2bb89e0710e8e3da2a206673a783d (patch) | |
tree | cdb058c4c12a65f9f565b6fef6ec07c871eafbd7 | |
parent | 242620b73e221916257e1f1184430d8521fe7855 (diff) | |
parent | 3355afbbd197d6225d22a9ee405f2cb0a8376cbf (diff) |
Merge pull request #314 from eivindm/improved_heartbeat_in_watchface
Improve design of heartbeat data in digital watchface
-rw-r--r-- | src/displayapp/screens/WatchFaceDigital.cpp | 17 |
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(); |