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**_
This commit is contained in:
@@ -239,7 +239,11 @@ void FileBrowserActivity::loop() {
|
||||
|
||||
std::string getFileName(std::string filename) {
|
||||
if (filename.back() == '/') {
|
||||
return filename.substr(0, filename.length() - 1);
|
||||
filename.pop_back();
|
||||
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
|
||||
return "[" + filename + "]";
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
const auto pos = filename.rfind('.');
|
||||
return filename.substr(0, pos);
|
||||
|
||||
Reference in New Issue
Block a user