Provide visual progress feedback during indexing

This commit is contained in:
jpirnay
2026-03-23 11:29:33 +01:00
parent 5458155e79
commit 2d1f635f10
5 changed files with 32 additions and 11 deletions
+8 -2
View File
@@ -544,12 +544,18 @@ void EpubReaderActivity::render(RenderLock&& lock) {
SETTINGS.imageRendering)) {
LOG_DBG("ERS", "Cache not found, building...");
const auto popupFn = [this]() { GUI.drawPopup(renderer, tr(STR_INDEXING)); };
Rect popupRect{};
const auto progressFn = [this, &popupRect](int progress) {
if (popupRect.width == 0) {
popupRect = GUI.drawPopup(renderer, tr(STR_INDEXING));
}
GUI.fillPopupProgress(renderer, popupRect, progress);
};
if (!section->createSectionFile(SETTINGS.getReaderFontId(), SETTINGS.getReaderLineCompression(),
SETTINGS.extraParagraphSpacing, SETTINGS.paragraphAlignment, viewportWidth,
viewportHeight, SETTINGS.hyphenationEnabled, SETTINGS.embeddedStyle,
SETTINGS.imageRendering, popupFn)) {
SETTINGS.imageRendering, progressFn)) {
LOG_ERR("ERS", "Failed to persist page data to SD");
section.reset();
return;