From ee208275f20284c2df952ed302f5dde45ee009c7 Mon Sep 17 00:00:00 2001 From: philmoz Date: Tue, 24 Jan 2023 19:17:07 +1100 Subject: [PATCH] fix(color): Center align text in number input boxes for curve editor (#3094) --- radio/src/gui/colorlcd/curveedit.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/radio/src/gui/colorlcd/curveedit.cpp b/radio/src/gui/colorlcd/curveedit.cpp index b276100d2..b0aae8692 100644 --- a/radio/src/gui/colorlcd/curveedit.cpp +++ b/radio/src/gui/colorlcd/curveedit.cpp @@ -61,7 +61,7 @@ void CurveDataEdit::curvePointsRow(FormGroup::Line* parent, int start, int count // Point number for (int i = 0; i < count; i++) { - auto txt = new StaticText(line, rect_t{}, std::to_string(i + start + 1), 0, FONT(XS) | CENTERED | COLOR_THEME_PRIMARY1); + new StaticText(line, rect_t{}, std::to_string(i + start + 1), 0, FONT(XS) | CENTERED | COLOR_THEME_PRIMARY1); } line = form->newLine(&grid); @@ -106,6 +106,7 @@ void CurveDataEdit::curvePointsRow(FormGroup::Line* parent, int start, int count }, 0, RIGHT); lv_obj_set_grid_cell(numEditX[px]->getLvObj(), LV_GRID_ALIGN_CENTER, i+1, 1, LV_GRID_ALIGN_CENTER, 0, 1); + lv_textarea_set_align(numEditX[px]->getLvObj(), LV_TEXT_ALIGN_CENTER); } if ((start + count) == curvePointsCount) { new StaticText(line, rect_t{}, "100", 0, CENTERED | COLOR_THEME_SECONDARY1); @@ -138,6 +139,7 @@ void CurveDataEdit::curvePointsRow(FormGroup::Line* parent, int start, int count }, 0, RIGHT); lv_obj_set_grid_cell(numedit->getLvObj(), LV_GRID_ALIGN_CENTER, i+1, 1, LV_GRID_ALIGN_CENTER, 0, 1); + lv_textarea_set_align(numedit->getLvObj(), LV_TEXT_ALIGN_CENTER); } }