Skip to content

Commit 6a91b83

Browse files
authored
Change step gauge range to 100 and calculate progress as percantage (#468)
1 parent 084123b commit 6a91b83

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/displayapp/screens/PineTimeStyle.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,8 @@ PineTimeStyle::PineTimeStyle(DisplayApp* app,
179179
lv_obj_align(stepGauge, sidebar, LV_ALIGN_IN_BOTTOM_MID, 0, 0);
180180
lv_gauge_set_scale(stepGauge, 360, 11, 0);
181181
lv_gauge_set_angle_offset(stepGauge, 180);
182-
lv_gauge_set_critical_value(stepGauge, (settingsController.GetStepsGoal() / 100));
183-
lv_gauge_set_range(stepGauge, 0, (settingsController.GetStepsGoal() / 100));
182+
lv_gauge_set_critical_value(stepGauge, 100);
183+
lv_gauge_set_range(stepGauge, 0, 100);
184184
lv_gauge_set_value(stepGauge, 0, 0);
185185

186186
lv_obj_set_style_local_pad_right(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, 3);
@@ -328,7 +328,7 @@ bool PineTimeStyle::Refresh() {
328328
stepCount = motionController.NbSteps();
329329
motionSensorOk = motionController.IsSensorOk();
330330
if (stepCount.IsUpdated() || motionSensorOk.IsUpdated()) {
331-
lv_gauge_set_value(stepGauge, 0, (stepCount.Get() / 100));
331+
lv_gauge_set_value(stepGauge, 0, (stepCount.Get() / (settingsController.GetStepsGoal() / 100)));
332332
lv_obj_realign(stepGauge);
333333
if (stepCount.Get() > settingsController.GetStepsGoal()) {
334334
lv_obj_set_style_local_line_color(stepGauge, LV_GAUGE_PART_MAIN, LV_STATE_DEFAULT, LV_COLOR_WHITE);

0 commit comments

Comments
 (0)