66using namespace Pinetime ::Applications::Screens;
77
88Steps::Steps (
9- Pinetime::Applications::DisplayApp *app,
9+ Pinetime::Applications::DisplayApp *app,
1010 Controllers::MotionController& motionController,
11- Controllers::Settings &settingsController)
12- : Screen(app),
11+ Controllers::Settings &settingsController)
12+ : Screen(app),
1313 motionController{motionController},
1414 settingsController{settingsController} {
1515
1616 stepsArc = lv_arc_create (lv_scr_act (), nullptr );
1717
18- lv_obj_set_style_local_bg_opa (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
19- lv_obj_set_style_local_border_width (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 2 );
20- lv_obj_set_style_local_radius (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0 );
21- lv_obj_set_style_local_line_color (stepsArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, lv_color_hex (0x0000FF ));
18+ lv_obj_set_style_local_bg_opa (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
19+ lv_obj_set_style_local_border_width (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 2 );
20+ lv_obj_set_style_local_radius (stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0 );
21+ lv_obj_set_style_local_line_color (stepsArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, lv_color_hex (0x0000FF ));
2222 lv_arc_set_end_angle (stepsArc, 200 );
2323 lv_obj_set_size (stepsArc, 220 , 220 );
2424 lv_arc_set_range (stepsArc, 0 , 500 );
@@ -36,7 +36,7 @@ Steps::Steps(
3636
3737 lv_obj_t * lstepsL = lv_label_create (lv_scr_act (), nullptr );
3838 lv_obj_set_style_local_text_color (lstepsL, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex (0x111111 ));
39- lv_label_set_text_static (lstepsL, " Steps" );
39+ lv_label_set_text_static (lstepsL, " Steps" );
4040 lv_obj_align (lstepsL, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0 , 10 );
4141
4242 lv_obj_t * lstepsGoal = lv_label_create (lv_scr_act (), nullptr );
@@ -45,28 +45,25 @@ Steps::Steps(
4545 lv_label_set_align (lstepsGoal, LV_LABEL_ALIGN_CENTER);
4646 lv_obj_align (lstepsGoal, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0 , 60 );
4747
48- lv_obj_t * backgroundLabel = lv_label_create (lv_scr_act (), nullptr );
48+ lv_obj_t * backgroundLabel = lv_label_create (lv_scr_act (), nullptr );
4949 lv_label_set_long_mode (backgroundLabel, LV_LABEL_LONG_CROP);
5050 lv_obj_set_size (backgroundLabel, 240 , 240 );
5151 lv_obj_set_pos (backgroundLabel, 0 , 0 );
5252 lv_label_set_text_static (backgroundLabel, " " );
53-
5453}
5554
5655Steps::~Steps () {
5756 lv_obj_clean (lv_scr_act ());
5857}
5958
6059bool Steps::Refresh () {
61-
62- stepsCount = motionController.NbSteps ();
6360
64- lv_label_set_text_fmt (lSteps," %li" , stepsCount);
61+ stepsCount = motionController.NbSteps ();
62+
63+ lv_label_set_text_fmt (lSteps, " %li" , stepsCount);
6564 lv_obj_align (lSteps, nullptr , LV_ALIGN_CENTER, 0 , -20 );
66-
65+
6766 lv_arc_set_value (stepsArc, int16_t (500 * stepsCount / settingsController.GetStepsGoal ()));
6867
6968 return running;
7069}
71-
72-
0 commit comments