Properly wrap message
This commit is contained in:
@@ -22,10 +22,9 @@ void SdFirmwareUpdateActivity::onEnter() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SdFirmwareUpdateActivity::launchPicker() {
|
void SdFirmwareUpdateActivity::launchPicker() {
|
||||||
startActivityForResult(
|
startActivityForResult(std::make_unique<FileBrowserActivity>(renderer, mappedInput, "/", std::string{},
|
||||||
std::make_unique<FileBrowserActivity>(renderer, mappedInput, "/", std::string{},
|
FileBrowserActivity::Mode::PickFirmware),
|
||||||
FileBrowserActivity::Mode::PickFirmware),
|
[this](const ActivityResult& result) { onPickerResult(result); });
|
||||||
[this](const ActivityResult& result) { onPickerResult(result); });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SdFirmwareUpdateActivity::onPickerResult(const ActivityResult& 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));
|
renderer.drawCenteredText(UI_10_FONT_ID, y, tr(STR_FIRMWARE_UPDATE_DO_NOT_POWER_OFF));
|
||||||
} else if (state == State::SUCCESS) {
|
} 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, 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) {
|
} else if (state == State::FAILED) {
|
||||||
renderer.drawCenteredText(UI_10_FONT_ID, top, tr(STR_UPDATE_FAILED), true, EpdFontFamily::BOLD);
|
renderer.drawCenteredText(UI_10_FONT_ID, top, tr(STR_UPDATE_FAILED), true, EpdFontFamily::BOLD);
|
||||||
if (!errorMessage.empty()) {
|
if (!errorMessage.empty()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user