summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/HeartRate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/screens/HeartRate.cpp')
-rw-r--r--src/displayapp/screens/HeartRate.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/displayapp/screens/HeartRate.cpp b/src/displayapp/screens/HeartRate.cpp
index d55ed019..401d57d9 100644
--- a/src/displayapp/screens/HeartRate.cpp
+++ b/src/displayapp/screens/HeartRate.cpp
@@ -5,8 +5,6 @@
#include "../DisplayApp.h"
using namespace Pinetime::Applications::Screens;
-extern lv_font_t jetbrains_mono_extrabold_compressed;
-extern lv_font_t jetbrains_mono_bold_20;
namespace {
const char *ToString(Pinetime::Controllers::HeartRateController::States s) {
@@ -30,28 +28,22 @@ namespace {
}
HeartRate::HeartRate(Pinetime::Applications::DisplayApp *app, Controllers::HeartRateController& heartRateController) : Screen(app), heartRateController{heartRateController} {
- label_bpm = lv_label_create(lv_scr_act(), NULL);
-
- labelStyle = const_cast<lv_style_t *>(lv_label_get_style(label_bpm, LV_LABEL_STYLE_MAIN));
- labelStyle->text.font = &jetbrains_mono_bold_20;
-
- lv_style_copy(&labelBigStyle, labelStyle);
- labelBigStyle.text.font = &jetbrains_mono_extrabold_compressed;
+
+ label_hr = lv_label_create(lv_scr_act(), NULL);
- lv_label_set_style(label_bpm, LV_LABEL_STYLE_MAIN, labelStyle);
+ lv_obj_set_style_local_text_font(label_hr, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, &jetbrains_mono_extrabold_compressed);
- label_hr = lv_label_create(lv_scr_act(), NULL);
- lv_label_set_style(label_hr, LV_LABEL_STYLE_MAIN, &labelBigStyle);
lv_obj_align(label_hr, lv_scr_act(), LV_ALIGN_CENTER, -70, -40);
lv_label_set_text(label_hr, "000");
+ label_bpm = lv_label_create(lv_scr_act(), NULL);
lv_label_set_text(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(), NULL);
lv_label_set_text(label_status, ToString(Pinetime::Controllers::HeartRateController::States::NotEnoughData));
- lv_label_set_style(label_status, LV_LABEL_STYLE_MAIN, labelStyle);
+
lv_obj_align(label_status, label_hr, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
btn_startStop = lv_btn_create(lv_scr_act(), NULL);