From ad9137cfdf6b5430d247ea066513dfc46ae17e5a Mon Sep 17 00:00:00 2001 From: Lev Roland-Kalb <114942703+Levrk@users.noreply.github.com> Date: Mon, 16 Feb 2026 08:33:43 -0500 Subject: [PATCH] fix: added cover image outlines to improve legibility (#907) ## Summary * **What is the goal of this PR?** (e.g., Implements the new feature for file uploading.) Improve legibility of Cover Icons on the home page and elsewhere. Fixes #898 * **What changes are included?** Cover outline is now shown even when cover is found to prevent issues with low contrast covers blending into the background. Photo is attached below: Group 1 (4) ## Additional Context * Add any other information that might be helpful for the reviewer (e.g., performance implications, potential risks, specific areas to focus on). Not much else to say here. I did simplify the logic in lyratheme.cpp based on there no longer being a requirement for any non-cover specific rendering differences. --- ### AI Usage While CrossPoint doesn't have restrictions on AI tools in contributing, please be transparent about their usage as it helps set the right context for reviewers. Did you use AI tools to help write this code? _**NO**_ --- src/components/themes/lyra/LyraTheme.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/components/themes/lyra/LyraTheme.cpp b/src/components/themes/lyra/LyraTheme.cpp index 722ed6db..441b5bd1 100644 --- a/src/components/themes/lyra/LyraTheme.cpp +++ b/src/components/themes/lyra/LyraTheme.cpp @@ -276,11 +276,10 @@ void LyraTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std: for (int i = 0; i < std::min(static_cast(recentBooks.size()), LyraMetrics::values.homeRecentBooksCount); i++) { std::string coverPath = recentBooks[i].coverBmpPath; - bool hasCover = true; int tileX = LyraMetrics::values.contentSidePadding + tileWidth * i; - if (coverPath.empty()) { - hasCover = false; - } else { + renderer.drawRect(tileX + hPaddingInSelection, tileY + hPaddingInSelection, tileWidth - 2 * hPaddingInSelection, + LyraMetrics::values.homeCoverHeight); + if (!coverPath.empty()) { const std::string coverBmpPath = UITheme::getCoverThumbPath(coverPath, LyraMetrics::values.homeCoverHeight); // First time: load cover from SD and render @@ -294,20 +293,12 @@ void LyraTheme::drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std: const float tileRatio = static_cast(tileWidth - 2 * hPaddingInSelection) / static_cast(LyraMetrics::values.homeCoverHeight); float cropX = 1.0f - (tileRatio / ratio); - renderer.drawBitmap(bitmap, tileX + hPaddingInSelection, tileY + hPaddingInSelection, tileWidth - 2 * hPaddingInSelection, LyraMetrics::values.homeCoverHeight, cropX); - } else { - hasCover = false; } file.close(); } } - - if (!hasCover) { - renderer.drawRect(tileX + hPaddingInSelection, tileY + hPaddingInSelection, - tileWidth - 2 * hPaddingInSelection, LyraMetrics::values.homeCoverHeight); - } } coverBufferStored = storeCoverBuffer();