Properly wrap message

This commit is contained in:
jpirnay
2026-05-07 19:54:40 +02:00
parent a0aee0ba1b
commit eb203f3ba3
@@ -22,10 +22,9 @@ void SdFirmwareUpdateActivity::onEnter() {
}
void SdFirmwareUpdateActivity::launchPicker() {
startActivityForResult(
std::make_unique<FileBrowserActivity>(renderer, mappedInput, "/", std::string{},
FileBrowserActivity::Mode::PickFirmware),
[this](const ActivityResult& result) { onPickerResult(result); });
startActivityForResult(std::make_unique<FileBrowserActivity>(renderer, mappedInput, "/", std::string{},
FileBrowserActivity::Mode::PickFirmware),
[this](const ActivityResult& result) { onPickerResult(result); });
}
void SdFirmwareUpdateActivity::onPickerResult(const ActivityResult& result) {
@@ -214,7 +213,13 @@ void SdFirmwareUpdateActivity::render(RenderLock&&) {
renderer.drawCenteredText(UI_10_FONT_ID, y, tr(STR_FIRMWARE_UPDATE_DO_NOT_POWER_OFF));
} else if (state == State::SUCCESS) {
renderer.drawCenteredText(UI_10_FONT_ID, top, tr(STR_UPDATE_COMPLETE), true, EpdFontFamily::BOLD);
renderer.drawCenteredText(UI_10_FONT_ID, top + lineHeight + metrics.verticalSpacing, tr(STR_RESTARTING_HINT));
const int hintWidth = pageWidth - 2 * metrics.contentSidePadding;
const auto hintLines = renderer.wrappedText(UI_10_FONT_ID, tr(STR_RESTARTING_HINT), hintWidth, 4);
int hintY = top + lineHeight + metrics.verticalSpacing;
for (const auto& line : hintLines) {
renderer.drawCenteredText(UI_10_FONT_ID, hintY, line.c_str());
hintY += lineHeight;
}
} else if (state == State::FAILED) {
renderer.drawCenteredText(UI_10_FONT_ID, top, tr(STR_UPDATE_FAILED), true, EpdFontFamily::BOLD);
if (!errorMessage.empty()) {