@@ -16,6 +16,10 @@ void PageIndicator::Create() {
1616 lv_obj_set_style_local_line_width (pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3 );
1717 lv_obj_set_style_local_line_color (pageIndicatorBase, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::bgDark);
1818 lv_line_set_points (pageIndicatorBase, pageIndicatorBasePoints, 2 );
19+
20+ pageIndicator = lv_line_create (lv_scr_act (), nullptr );
21+ lv_obj_set_style_local_line_width (pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3 );
22+ lv_obj_set_style_local_line_color (pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
1923 SetPageIndicatorPosition (nCurrentScreen);
2024}
2125
@@ -28,13 +32,5 @@ void PageIndicator::SetPageIndicatorPosition(uint8_t position) {
2832 pageIndicatorPoints[1 ].x = LV_HOR_RES - 1 ;
2933 pageIndicatorPoints[1 ].y = indicatorPos + indicatorSize;
3034
31- pageIndicator = lv_line_create (lv_scr_act (), nullptr );
32- lv_obj_set_style_local_line_width (pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, 3 );
33- lv_obj_set_style_local_line_color (pageIndicator, LV_LINE_PART_MAIN, LV_STATE_DEFAULT, Colors::lightGray);
3435 lv_line_set_points (pageIndicator, pageIndicatorPoints, 2 );
3536}
36-
37- void PageIndicator::SetCurrentScreen (uint8_t nScreen) {
38- lv_obj_del (pageIndicator);
39- SetPageIndicatorPosition (nScreen);
40- }
0 commit comments