aboutsummaryrefslogtreecommitdiffstats
path: root/src/displayapp/widgets/PageIndicator.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/displayapp/widgets/PageIndicator.cpp')
-rw-r--r--src/displayapp/widgets/PageIndicator.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/displayapp/widgets/PageIndicator.cpp b/src/displayapp/widgets/PageIndicator.cpp
index 5d9815da..cee979f2 100644
--- a/src/displayapp/widgets/PageIndicator.cpp
+++ b/src/displayapp/widgets/PageIndicator.cpp
@@ -16,6 +16,10 @@ void PageIndicator::Create() {
lv_obj_set_style_local_line_width(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
lv_obj_set_style_local_line_color(pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::bgDark);
lv_line_set_points(pageIndicatorBase, pageIndicatorBasePoints, 2);
+
+ pageIndicator = lv_line_create(lv_scr_act(), nullptr);
+ lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
+ lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
SetPageIndicatorPosition(nCurrentScreen);
}
@@ -28,13 +32,5 @@ void PageIndicator::SetPageIndicatorPosition(uint8_t position) {
pageIndicatorPoints[1].x = LV_HOR_RES - 1;
pageIndicatorPoints[1].y = indicatorPos + indicatorSize;
- pageIndicator = lv_line_create(lv_scr_act(), nullptr);
- lv_obj_set_style_local_line_width(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3);
- lv_obj_set_style_local_line_color(pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
lv_line_set_points(pageIndicator, pageIndicatorPoints, 2);
}
-
-void PageIndicator::SetCurrentScreen(uint8_t nScreen) {
- lv_obj_del(pageIndicator);
- SetPageIndicatorPosition(nScreen);
-}