Dont add brackets around directory for themes that have icon support
This commit is contained in:
@@ -238,7 +238,11 @@ void FileBrowserActivity::loop() {
|
||||
|
||||
std::string getFileName(std::string filename) {
|
||||
if (filename.back() == '/') {
|
||||
return "[" + filename.substr(0, filename.length() - 1) + "]";
|
||||
filename = filename.substr(0, filename.length() - 1);
|
||||
if (!UITheme::getInstance().getTheme().showsFileIcons()) {
|
||||
return "[" + filename + "]";
|
||||
}
|
||||
return filename;
|
||||
}
|
||||
const auto pos = filename.rfind('.');
|
||||
return filename.substr(0, pos);
|
||||
|
||||
@@ -141,4 +141,5 @@ class BaseTheme {
|
||||
virtual void drawHelpText(const GfxRenderer& renderer, Rect rect, const char* label) const;
|
||||
virtual void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const;
|
||||
virtual void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const;
|
||||
virtual bool showsFileIcons() const { return false; }
|
||||
};
|
||||
|
||||
@@ -68,4 +68,5 @@ class LyraTheme : public BaseTheme {
|
||||
void fillPopupProgress(const GfxRenderer& renderer, const Rect& layout, const int progress) const override;
|
||||
void drawTextField(const GfxRenderer& renderer, Rect rect, const int textWidth) const override;
|
||||
void drawKeyboardKey(const GfxRenderer& renderer, Rect rect, const char* label, const bool isSelected) const override;
|
||||
bool showsFileIcons() const override { return true; }
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user