Show book title instead of "Select Chapter". (#169)

I think this is nicer ;)
This commit is contained in:
Jonas Diemer
2025-12-30 23:10:41 +01:00
committed by GitHub
parent 93226c9fbb
commit 06065dfd8b
4 changed files with 17 additions and 7 deletions

View File

@@ -120,7 +120,9 @@ void EpubReaderChapterSelectionActivity::renderScreen() {
const auto pageWidth = renderer.getScreenWidth();
const int pageItems = getPageItems();
renderer.drawCenteredText(UI_12_FONT_ID, 15, "Select Chapter", true, BOLD);
std::string title = renderer.truncatedText(UI_12_FONT_ID, epub->getTitle().c_str(), pageWidth - 40, BOLD);
renderer.drawCenteredText(UI_12_FONT_ID, 15, title.c_str(), true, BOLD);
const auto pageStartIndex = selectorIndex / pageItems * pageItems;
renderer.fillRect(0, 60 + (selectorIndex % pageItems) * 30 - 2, pageWidth - 1, 30);