Proper linewrap and centering

This commit is contained in:
jpirnay
2026-05-07 20:02:35 +02:00
parent eb203f3ba3
commit 3a93355d98
4 changed files with 52 additions and 56 deletions
@@ -160,7 +160,13 @@ void OtaUpdateActivity::render(RenderLock&&) {
GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4);
} else if (state == FINISHED) {
renderer.drawCenteredText(UI_10_FONT_ID, top, tr(STR_UPDATE_COMPLETE), true, EpdFontFamily::BOLD);
renderer.drawCenteredText(UI_10_FONT_ID, top + height + metrics.verticalSpacing, tr(STR_POWER_ON_HINT));
const int hintWidth = contentRect.width - 2 * metrics.contentSidePadding;
const auto hintLines = renderer.wrappedText(UI_10_FONT_ID, tr(STR_POWER_ON_HINT), hintWidth, 4);
int hintY = top + height + metrics.verticalSpacing;
for (const auto& line : hintLines) {
renderer.drawCenteredText(UI_10_FONT_ID, hintY, line.c_str());
hintY += height;
}
}
renderer.displayBuffer();