summaryrefslogtreecommitdiff
path: root/src/displayapp/screens/Meter.cpp
diff options
context:
space:
mode:
authorJoaquim <joaquim.org@gmail.com>2021-04-26 21:29:48 +0100
committerJoaquim <joaquim.org@gmail.com>2021-04-26 21:29:48 +0100
commitcd0d85dff95bbc5f285d92eb78a642aab1ae4b8b (patch)
treefc568aa2516c8c64cc55eb0d08e9a929c11b454a /src/displayapp/screens/Meter.cpp
parent5fc07a8df7d18d1fa9c4971f2c7b69ea68db559b (diff)
parenteedff2c06c292bda8dcb92fc04c67097fe72e22f (diff)
Merge branch 'develop' of
https://github.com/JF002/InfiniTime into StepsApp
Diffstat (limited to 'src/displayapp/screens/Meter.cpp')
-rw-r--r--src/displayapp/screens/Meter.cpp20
1 files changed, 9 insertions, 11 deletions
diff --git a/src/displayapp/screens/Meter.cpp b/src/displayapp/screens/Meter.cpp
index 2c042cac..e0dbdfad 100644
--- a/src/displayapp/screens/Meter.cpp
+++ b/src/displayapp/screens/Meter.cpp
@@ -4,35 +4,33 @@
using namespace Pinetime::Applications::Screens;
-
-Meter::Meter(Pinetime::Applications::DisplayApp *app) : Screen(app) {
+Meter::Meter(Pinetime::Applications::DisplayApp* app) : Screen(app) {
/*Create a line meter */
lmeter = lv_linemeter_create(lv_scr_act(), nullptr);
- lv_linemeter_set_range(lmeter, 0, 60); /*Set the range*/
- lv_linemeter_set_value(lmeter, value); /*Set the current value*/
+ lv_linemeter_set_range(lmeter, 0, 60); /*Set the range*/
+ lv_linemeter_set_value(lmeter, value); /*Set the current value*/
lv_linemeter_set_angle_offset(lmeter, 180);
- lv_linemeter_set_scale(lmeter, 360, 60); /*Set the angle and number of lines*/
+ lv_linemeter_set_scale(lmeter, 360, 60); /*Set the angle and number of lines*/
- lv_obj_set_style_local_scale_end_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(255,0,0));
- lv_obj_set_style_local_scale_grad_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(160,0,0));
+ lv_obj_set_style_local_scale_end_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(255, 0, 0));
+ lv_obj_set_style_local_scale_grad_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, lv_color_make(160, 0, 0));
lv_obj_set_style_local_line_width(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, 2);
lv_obj_set_style_local_line_color(lmeter, LV_LINEMETER_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_SILVER);
lv_obj_set_size(lmeter, 200, 200);
lv_obj_align(lmeter, nullptr, LV_ALIGN_CENTER, 0, 0);
-
}
Meter::~Meter() {
-
lv_obj_clean(lv_scr_act());
}
bool Meter::Refresh() {
- lv_linemeter_set_value(lmeter, value++); /*Set the current value*/
- if(value>=60) value = 0;
+ lv_linemeter_set_value(lmeter, value++); /*Set the current value*/
+ if (value >= 60)
+ value = 0;
return running;
}