24 lines
1.8 KiB
Markdown
24 lines
1.8 KiB
Markdown
|
|
# Expandable Selected Row for Long Filenames
|
||
|
|
|
||
|
|
## Task
|
||
|
|
|
||
|
|
Implement a mod enhancement to PR #1019 (Display file extensions in File Browser). When the selected row's filename is too long, expand that row to 2 lines with character-level text wrapping. The file extension moves to the bottom-right of the expanded area. Non-selected rows retain single-line truncation behavior.
|
||
|
|
|
||
|
|
## Changes Made
|
||
|
|
|
||
|
|
### `src/components/themes/BaseTheme.cpp`
|
||
|
|
- Added `wrapTextToLines` static helper in the anonymous namespace: character-level UTF-8-aware text wrapping with "..." truncation on the final line.
|
||
|
|
- Modified `drawList`: pre-loop expansion detection for the selected item, pagination adjustment (`pageItems - 1`), expanded selection highlight (`2 * rowHeight`), 2-line title rendering via `wrapTextToLines`, extension repositioned to bottom-right of expanded area, `yPos` tracking for subsequent items.
|
||
|
|
|
||
|
|
### `src/components/themes/lyra/LyraTheme.cpp`
|
||
|
|
- Added identical `wrapTextToLines` helper.
|
||
|
|
- Modified `drawList` with analogous expansion logic, adapted for Lyra-specific styling (rounded-rect selection highlight, icon support, scroll bar-aware content width, preliminary text width computation for expansion check).
|
||
|
|
|
||
|
|
### `mod/prs/MERGED.md`
|
||
|
|
- Updated PR #1019 section to document the mod enhancement, files modified, and design decisions.
|
||
|
|
|
||
|
|
## Follow-up Items
|
||
|
|
|
||
|
|
- Visual testing on device to verify text positioning and edge cases (very long single-word filenames, last item on page expanding, single-item lists).
|
||
|
|
- The page-up/page-down navigation in `MyLibraryActivity::loop()` uses the base `pageItems` from `getNumberOfItemsPerPage` which doesn't account for expansion. This causes a minor cosmetic mismatch (page jump size differs by 1 from visual page when expansion is active) but is functionally correct.
|