mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-14 01:15:38 -04:00
Added File Manager button to show hidden files (#1564)
* Add files via upload * Add files via upload * Add files via upload * Add files via upload
This commit is contained in:
parent
68f960e4e7
commit
7a87e3f3af
4 changed files with 54 additions and 1 deletions
|
@ -156,7 +156,7 @@ void FileManBaseView::load_directory_contents(const fs::path& dir_path) {
|
|||
|
||||
for (const auto& entry : fs::directory_iterator(dir_path, u"*")) {
|
||||
// Hide files starting with '.' (hidden / tmp).
|
||||
if (is_hidden_file(entry.path()))
|
||||
if (!show_hidden_files && is_hidden_file(entry.path()))
|
||||
continue;
|
||||
|
||||
if (fs::is_regular_file(entry.status())) {
|
||||
|
@ -568,6 +568,7 @@ FileManagerView::FileManagerView(
|
|||
&button_open_notepad,
|
||||
&button_rename_timestamp,
|
||||
&button_open_iq_trim,
|
||||
&button_show_hidden_files,
|
||||
});
|
||||
|
||||
menu_view.on_highlight = [this]() {
|
||||
|
@ -658,6 +659,12 @@ FileManagerView::FileManagerView(
|
|||
} else
|
||||
nav_.display_modal("IQ Trim", "Not a capture file.");
|
||||
};
|
||||
|
||||
button_show_hidden_files.on_select = [this]() {
|
||||
show_hidden_files = !show_hidden_files;
|
||||
button_show_hidden_files.set_color(show_hidden_files ? Color::green() : Color::dark_grey());
|
||||
reload_current();
|
||||
};
|
||||
}
|
||||
|
||||
} // namespace ui
|
||||
|
|
|
@ -104,6 +104,8 @@ class FileManBaseView : public View {
|
|||
std::vector<fileman_entry> entry_list{};
|
||||
std::vector<uint32_t> saved_index_stack{};
|
||||
|
||||
bool show_hidden_files{false};
|
||||
|
||||
Labels labels{
|
||||
{{0, 0}, "Path:", Color::light_grey()}};
|
||||
|
||||
|
@ -278,6 +280,12 @@ class FileManagerView : public FileManBaseView {
|
|||
{},
|
||||
&bitmap_icon_trim,
|
||||
Color::orange()};
|
||||
|
||||
NewButton button_show_hidden_files{
|
||||
{13 * 8, 34 * 8, 4 * 8, 32},
|
||||
{},
|
||||
&bitmap_icon_hide,
|
||||
Color::dark_grey()};
|
||||
};
|
||||
|
||||
} /* namespace ui */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue