summaryrefslogtreecommitdiff
path: root/src/displayapp/screens
diff options
context:
space:
mode:
authorAvamander <avamander@gmail.com>2021-07-04 21:06:50 +0300
committerGitHub <noreply@github.com>2021-07-04 20:06:50 +0200
commitab59b9b8301d95206a2f77a4e32e4f6552361a2e (patch)
tree52027acd2943184bd95abe1b1bfab3bc05cfb88c /src/displayapp/screens
parent3b0fcc2a73c81bc5e0da301fbbe95fdfd09339de (diff)
Whitespace and brace fixes (#456)
* Brace style and whitespace fixes * Additional whitespace fixes
Diffstat (limited to 'src/displayapp/screens')
-rw-r--r--src/displayapp/screens/Steps.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/src/displayapp/screens/Steps.cpp b/src/displayapp/screens/Steps.cpp
index cc78813f..6aabd30e 100644
--- a/src/displayapp/screens/Steps.cpp
+++ b/src/displayapp/screens/Steps.cpp
@@ -6,19 +6,19 @@
using namespace Pinetime::Applications::Screens;
Steps::Steps(
- Pinetime::Applications::DisplayApp *app,
+ Pinetime::Applications::DisplayApp *app,
Controllers::MotionController& motionController,
- Controllers::Settings &settingsController)
- : Screen(app),
+ Controllers::Settings &settingsController)
+ : Screen(app),
motionController{motionController},
settingsController{settingsController} {
stepsArc = lv_arc_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_bg_opa(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
- lv_obj_set_style_local_border_width(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 2);
- lv_obj_set_style_local_radius(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
- lv_obj_set_style_local_line_color(stepsArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, lv_color_hex(0x0000FF));
+ lv_obj_set_style_local_bg_opa(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, LV_OPA_0);
+ lv_obj_set_style_local_border_width(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 2);
+ lv_obj_set_style_local_radius(stepsArc, LV_ARC_PART_BG, LV_STATE_DEFAULT, 0);
+ lv_obj_set_style_local_line_color(stepsArc, LV_ARC_PART_INDIC, LV_STATE_DEFAULT, lv_color_hex(0x0000FF));
lv_arc_set_end_angle(stepsArc, 200);
lv_obj_set_size(stepsArc, 220, 220);
lv_arc_set_range(stepsArc, 0, 500);
@@ -36,7 +36,7 @@ Steps::Steps(
lv_obj_t * lstepsL = lv_label_create(lv_scr_act(), nullptr);
lv_obj_set_style_local_text_color(lstepsL, LV_LABEL_PART_MAIN, LV_STATE_DEFAULT, lv_color_hex(0x111111));
- lv_label_set_text_static(lstepsL, "Steps");
+ lv_label_set_text_static(lstepsL, "Steps");
lv_obj_align(lstepsL, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 10);
lv_obj_t * lstepsGoal = lv_label_create(lv_scr_act(), nullptr);
@@ -45,12 +45,11 @@ Steps::Steps(
lv_label_set_align(lstepsGoal, LV_LABEL_ALIGN_CENTER);
lv_obj_align(lstepsGoal, lSteps, LV_ALIGN_OUT_BOTTOM_MID, 0, 60);
- lv_obj_t * backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
+ lv_obj_t* backgroundLabel = lv_label_create(lv_scr_act(), nullptr);
lv_label_set_long_mode(backgroundLabel, LV_LABEL_LONG_CROP);
lv_obj_set_size(backgroundLabel, 240, 240);
lv_obj_set_pos(backgroundLabel, 0, 0);
lv_label_set_text_static(backgroundLabel, "");
-
}
Steps::~Steps() {
@@ -58,15 +57,13 @@ Steps::~Steps() {
}
bool Steps::Refresh() {
-
- stepsCount = motionController.NbSteps();
- lv_label_set_text_fmt(lSteps,"%li", stepsCount);
+ stepsCount = motionController.NbSteps();
+
+ lv_label_set_text_fmt(lSteps, "%li", stepsCount);
lv_obj_align(lSteps, nullptr, LV_ALIGN_CENTER, 0, -20);
-
+
lv_arc_set_value(stepsArc, int16_t(500 * stepsCount / settingsController.GetStepsGoal()));
return running;
}
-
-