Fix text centering in cover art thumbnails to align within cell bounds

This commit is contained in:
altsysrq 2026-01-04 15:17:18 -06:00
parent 8ca01e9ede
commit 1d8815249d
2 changed files with 7 additions and 2 deletions

View File

@ -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

View File

@ -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 {