A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

feat: Display file extensions in File Browser (#1019)

## Summary

![IMG_8136
Medium](https://github.com/user-attachments/assets/e33a8a71-4126-4bdc-8d3a-32132acba712)
![IMG_8137
Medium](https://github.com/user-attachments/assets/2289fbee-71e8-446c-ad28-9dd4a9a21396)
![IMG_8138
Medium](https://github.com/user-attachments/assets/0e912f72-9be1-4708-a909-4dab192d1aea)


## Additional Context

Do we want a setting to toggle this?

---

### AI Usage

Did you use AI tools to help write this code? _**NO**_

authored by

CaptainFrito and committed by
GitHub
5349e817 825ef56a

+10 -1
+10 -1
src/activities/home/FileBrowserActivity.cpp
··· 249 249 return filename.substr(0, pos); 250 250 } 251 251 252 + std::string getFileExtension(std::string filename) { 253 + if (filename.back() == '/') { 254 + return ""; 255 + } 256 + const auto pos = filename.rfind('.'); 257 + return filename.substr(pos); 258 + } 259 + 252 260 void FileBrowserActivity::render(RenderLock&&) { 253 261 renderer.clearScreen(); 254 262 ··· 267 275 GUI.drawList( 268 276 renderer, Rect{0, contentTop, pageWidth, contentHeight}, files.size(), selectorIndex, 269 277 [this](int index) { return getFileName(files[index]); }, nullptr, 270 - [this](int index) { return UITheme::getFileIcon(files[index]); }); 278 + [this](int index) { return UITheme::getFileIcon(files[index]); }, 279 + [this](int index) { return getFileExtension(files[index]); }, false); 271 280 } 272 281 273 282 // Help text