Smaller font size
This commit is contained in:
@@ -100,7 +100,13 @@ void RecentBooksActivity::render(RenderLock&&) {
|
||||
} else {
|
||||
GUI.drawList(
|
||||
renderer, Rect{0, contentTop, pageWidth, contentHeight}, recentBooks.size(), selectorIndex,
|
||||
[this](int index) { return recentBooks[index].title; }, [this](int index) { return recentBooks[index].author; },
|
||||
[this](int index) { return recentBooks[index].title; },
|
||||
[this](int index) {
|
||||
const auto& book = recentBooks[index];
|
||||
if (!book.author.empty() && !book.series.empty()) return book.author + " \u2022 " + book.series;
|
||||
if (!book.series.empty()) return book.series;
|
||||
return book.author;
|
||||
},
|
||||
[this](int index) { return UITheme::getFileIcon(recentBooks[index].path); });
|
||||
}
|
||||
|
||||
|
||||
@@ -496,7 +496,7 @@ void BaseTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
totalTextHeight += renderer.getLineHeight(UI_10_FONT_ID) * 3 / 2;
|
||||
}
|
||||
if (!lastBookSeries.empty()) {
|
||||
totalTextHeight += renderer.getLineHeight(UI_12_FONT_ID);
|
||||
totalTextHeight += renderer.getLineHeight(UI_10_FONT_ID);
|
||||
}
|
||||
|
||||
// Vertically center the title block within the card
|
||||
@@ -507,7 +507,7 @@ void BaseTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
: renderer.truncatedText(UI_10_FONT_ID, lastBookAuthor.c_str(), bookWidth - 40);
|
||||
const auto truncatedSeries = lastBookSeries.empty()
|
||||
? std::string{}
|
||||
: renderer.truncatedText(UI_12_FONT_ID, lastBookSeries.c_str(), bookWidth - 40);
|
||||
: renderer.truncatedText(UI_10_FONT_ID, lastBookSeries.c_str(), bookWidth - 40);
|
||||
|
||||
// If cover image was rendered, draw box behind title, author, and series
|
||||
if (coverRendered) {
|
||||
@@ -527,7 +527,7 @@ void BaseTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
}
|
||||
}
|
||||
if (!truncatedSeries.empty()) {
|
||||
const int seriesWidth = renderer.getTextWidth(UI_12_FONT_ID, truncatedSeries.c_str());
|
||||
const int seriesWidth = renderer.getTextWidth(UI_10_FONT_ID, truncatedSeries.c_str());
|
||||
if (seriesWidth > maxTextWidth) {
|
||||
maxTextWidth = seriesWidth;
|
||||
}
|
||||
@@ -556,7 +556,7 @@ void BaseTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
}
|
||||
|
||||
if (!truncatedSeries.empty()) {
|
||||
renderer.drawCenteredText(UI_12_FONT_ID, titleYStart, truncatedSeries.c_str(), !bookSelected);
|
||||
renderer.drawCenteredText(UI_10_FONT_ID, titleYStart, truncatedSeries.c_str(), !bookSelected);
|
||||
}
|
||||
|
||||
// "Continue Reading" label at the bottom
|
||||
|
||||
@@ -487,11 +487,11 @@ void LyraTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
auto titleLines = renderer.wrappedText(UI_12_FONT_ID, book.title.c_str(), textWidth, 3, EpdFontFamily::BOLD);
|
||||
|
||||
auto author = renderer.truncatedText(UI_10_FONT_ID, book.author.c_str(), textWidth);
|
||||
auto series = renderer.truncatedText(UI_12_FONT_ID, book.series.c_str(), textWidth);
|
||||
auto series = renderer.truncatedText(UI_10_FONT_ID, book.series.c_str(), textWidth);
|
||||
const int titleLineHeight = renderer.getLineHeight(UI_12_FONT_ID);
|
||||
const int titleBlockHeight = titleLineHeight * static_cast<int>(titleLines.size());
|
||||
const int authorHeight = book.author.empty() ? 0 : (renderer.getLineHeight(UI_10_FONT_ID) * 3 / 2);
|
||||
const int seriesHeight = book.series.empty() ? 0 : renderer.getLineHeight(UI_12_FONT_ID);
|
||||
const int seriesHeight = book.series.empty() ? 0 : renderer.getLineHeight(UI_10_FONT_ID);
|
||||
const int totalBlockHeight = titleBlockHeight + authorHeight + seriesHeight;
|
||||
int titleY = tileY + tileHeight / 2 - totalBlockHeight / 2;
|
||||
const int textX = tileX + hPaddingInSelection + coverWidth + LyraMetrics::values.verticalSpacing;
|
||||
@@ -505,7 +505,7 @@ void LyraTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std:
|
||||
titleY += renderer.getLineHeight(UI_10_FONT_ID);
|
||||
}
|
||||
if (!book.series.empty()) {
|
||||
renderer.drawText(UI_12_FONT_ID, textX, titleY, series.c_str(), true);
|
||||
renderer.drawText(UI_10_FONT_ID, textX, titleY, series.c_str(), true);
|
||||
}
|
||||
} else {
|
||||
drawEmptyRecents(renderer, rect);
|
||||
|
||||
Reference in New Issue
Block a user