From 1d8815249dfd8facec454290c27ed8063007dedc Mon Sep 17 00:00:00 2001 From: altsysrq Date: Sun, 4 Jan 2026 15:17:18 -0600 Subject: [PATCH] Fix text centering in cover art thumbnails to align within cell bounds --- README.md | 3 ++- src/activities/reader/CoverArtPickerActivity.cpp | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b02d9a1f..e0727e8a 100644 --- a/README.md +++ b/README.md @@ -40,7 +40,8 @@ This project is **not affiliated with Xteink**; it's built as a community projec - [ ] User provided fonts - [ ] Full UTF support - [x] Screen rotation -- [x] Bluetooth LE Support +- [ ] Bluetooth LE Support +- [ ] FTP server support - [x] Adjustable sleep timer - [x] Set default folder diff --git a/src/activities/reader/CoverArtPickerActivity.cpp b/src/activities/reader/CoverArtPickerActivity.cpp index 2470dfd4..77c1bded 100644 --- a/src/activities/reader/CoverArtPickerActivity.cpp +++ b/src/activities/reader/CoverArtPickerActivity.cpp @@ -296,7 +296,11 @@ void CoverArtPickerActivity::drawCoverThumbnail(const std::string& filePath, int // Fallback: show filename with border renderer.drawRect(x + 20, y + 20, COVER_WIDTH - 40, COVER_HEIGHT - 60); - renderer.drawCenteredText(SMALL_FONT_ID, y + COVER_HEIGHT - 30, displayName.c_str(), true); + + // Draw filename centered within the cell (not screen-wide) + const int textWidth = renderer.getTextWidth(SMALL_FONT_ID, displayName.c_str()); + const int textX = x + (COVER_WIDTH - textWidth) / 2; + renderer.drawText(SMALL_FONT_ID, textX, y + COVER_HEIGHT - 30, displayName.c_str(), true); } void CoverArtPickerActivity::render() const {