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: Make directories stand out more in local file browser: "[dir]" instead of "dir" (#1339)

## Summary

* **What is the goal of this PR?** It's difficult to distinguish
directory names from normal file entries, so they are displayed now as
"[dir]" instead of "dir" for classic theme
* **What changes are included?**

## Additional Context

* Add any other information that might be helpful for the reviewer
(e.g., performance implications, potential risks,
specific areas to focus on).

---

### 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**_

authored by

jpirnay and committed by
GitHub
710055f0 02459721

+7 -1
+5 -1
src/activities/home/FileBrowserActivity.cpp
··· 239 239 240 240 std::string getFileName(std::string filename) { 241 241 if (filename.back() == '/') { 242 - return filename.substr(0, filename.length() - 1); 242 + filename.pop_back(); 243 + if (!UITheme::getInstance().getTheme().showsFileIcons()) { 244 + return "[" + filename + "]"; 245 + } 246 + return filename; 243 247 } 244 248 const auto pos = filename.rfind('.'); 245 249 return filename.substr(0, pos);
+1
src/components/themes/BaseTheme.h
··· 141 141 virtual void drawHelpText(const GfxRenderer& renderer, Rect rect, const char* label) const; 142 142 virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const; 143 143 virtual void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const; 144 + virtual bool showsFileIcons() const { return false; } 144 145 };
+1
src/components/themes/lyra/LyraTheme.h
··· 68 68 void fillPopupProgress(const GfxRenderer& renderer, const Rect& layout, const int progress) const override; 69 69 void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const override; 70 70 void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const override; 71 + bool showsFileIcons() const override { return true; } 71 72 };