Skip to content

Commit 134efa0

Browse files
committed
Fixup progress bar
1 parent 30c0fdc commit 134efa0

File tree

1 file changed

+10
-8
lines changed

1 file changed

+10
-8
lines changed

src/displayapp/screens/HeartRateZone.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,21 @@ HeartRateZone::HeartRateZone(Controllers::HeartRateController& heartRateControll
1919

2020
lv_obj_t* screen = lv_scr_act();
2121

22-
title = lv_label_create(screen);
22+
title = lv_label_create(screen, nullptr);
2323
lv_label_set_text_static(title, "BPM Breakdown");
2424
lv_obj_align(title, screen, LV_ALIGN_IN_TOP_MID, 0, 20);
2525

2626
total_bar = lv_bar_create(screen, nullptr);
27-
lv_obj_set_style_local_bg_opa(zone_bar[i], LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
28-
lv_obj_set_style_local_line_color(zone_bar[i], LV_BAR_PART_BG, LV_STATE_DEFAULT, Colors::bgAlt);
29-
lv_obj_set_style_local_border_width(zone_bar[i], LV_BAR_PART_BG, LV_STATE_DEFAULT, 2);
30-
lv_obj_set_style_local_radius(zone_bar[i], LV_BAR_PART_BG, LV_STATE_DEFAULT, 0);
31-
lv_obj_set_style_local_line_color(zone_bar[0], LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_NAVY);
27+
lv_obj_set_style_local_bg_opa(total_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
28+
lv_obj_set_style_local_line_color(total_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, Colors::bgAlt);
29+
lv_obj_set_style_local_border_width(total_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, 2);
30+
lv_obj_set_style_local_radius(total_bar, LV_BAR_PART_BG, LV_STATE_DEFAULT, 0);
31+
lv_obj_set_style_local_line_color(total_bar, LV_BAR_PART_INDIC, LV_STATE_DEFAULT, LV_COLOR_NAVY);
3232

3333
lv_obj_align(total_bar, screen, LV_ALIGN_IN_TOP_MID, 0, offset - (zone_bar.size() * 25));
3434

35-
total_label = lv_label_create(zone_bar[i], nullptr);
36-
lv_obj_align(total_label, zone_bar[i], LV_ALIGN_CENTER, 0, 0);
35+
total_label = lv_label_create(total_bar, nullptr);
36+
lv_obj_align(total_label, total_bar, LV_ALIGN_CENTER, 0, 0);
3737
lv_obj_set_style_local_text_color(total_label, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_CYAN);
3838

3939
for (uint8_t i = 0; i < zone_bar.size(); i++) {
@@ -89,9 +89,11 @@ HeartRateZone::~HeartRateZone() {
8989

9090
void HeartRateZone::Refresh() {
9191
auto activity = heartRateController.Activity();
92+
auto settings = heartRateController.hrzSettings();
9293
uint32_t total = 0;
9394

9495
auto hundreths_of_hour = pdMS_TO_TICKS(10 * 60 * 60);
96+
auto exercise_target = pdMS_TO_TICKS(settings.exerciseMsTarget);
9597

9698
for (uint8_t i = 0; i < zone_bar.size(); i++) {
9799
total += activity.zoneTime[i];

0 commit comments

Comments
 (0)