Replace lv_label_set_text where possible

This commit is contained in:
Riku Isokoski
2022-03-20 16:47:25 +02:00
parent ff73f67d6f
commit 68a7016080
22 changed files with 98 additions and 104 deletions

View File

@@ -41,16 +41,16 @@ HeartRate::HeartRate(Pinetime::Applications::DisplayApp* app,
else
lv_obj_set_style_local_text_color(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_GRAY);
lv_label_set_text(label_hr, "000");
lv_label_set_text_static(label_hr, "000");
lv_obj_align(label_hr, nullptr, LV_ALIGN_CENTER, 0, -40);
label_bpm = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_text(label_bpm, "Heart rate BPM");
lv_label_set_text_static(label_bpm, "Heart rate BPM");
lv_obj_align(label_bpm, label_hr, LV_ALIGN_OUT_TOP_MID, 0, -20);
label_status = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(label_status, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x222222));
lv_label_set_text(label_status, ToString(Pinetime::Controllers::HeartRateController::States::NotEnoughData));
lv_label_set_text_static(label_status, ToString(Pinetime::Controllers::HeartRateController::States::NotEnoughData));
lv_obj_align(label_status, label_hr, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
@@ -81,13 +81,13 @@ void HeartRate::Refresh() {
case Controllers::HeartRateController::States::NoTouch:
case Controllers::HeartRateController::States::NotEnoughData:
// case Controllers::HeartRateController::States::Stopped:
lv_label_set_text(label_hr, "000");
lv_label_set_text_static(label_hr, "000");
break;
default:
lv_label_set_text_fmt(label_hr, "%03d", heartRateController.HeartRate());
}
lv_label_set_text(label_status, ToString(state));
lv_label_set_text_static(label_status, ToString(state));
lv_obj_align(label_status, label_hr, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
}
@@ -109,7 +109,7 @@ void HeartRate::OnStartStopEvent(lv_event_t event) {
void HeartRate::UpdateStartStopButton(bool isRunning) {
if (isRunning)
lv_label_set_text(label_startStop, "Stop");
lv_label_set_text_static(label_startStop, "Stop");
else
lv_label_set_text(label_startStop, "Start");
lv_label_set_text_static(label_startStop, "Start");
}