From 7a87e3f3afd033f9b2931f5ff33151b9512bef6d Mon Sep 17 00:00:00 2001 From: Mark Thompson <129641948+NotherNgineer@users.noreply.github.com> Date: Mon, 6 Nov 2023 16:33:19 -0600 Subject: [PATCH] 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 --- firmware/application/apps/ui_fileman.cpp | 9 +++++- firmware/application/apps/ui_fileman.hpp | 8 +++++ firmware/application/bitmap.hpp | 38 +++++++++++++++++++++++ firmware/graphics/icon_hide.png | Bin 0 -> 202 bytes 4 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 firmware/graphics/icon_hide.png diff --git a/firmware/application/apps/ui_fileman.cpp b/firmware/application/apps/ui_fileman.cpp index e37f945b..cb359878 100644 --- a/firmware/application/apps/ui_fileman.cpp +++ b/firmware/application/apps/ui_fileman.cpp @@ -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 diff --git a/firmware/application/apps/ui_fileman.hpp b/firmware/application/apps/ui_fileman.hpp index c38e2c08..24a145eb 100644 --- a/firmware/application/apps/ui_fileman.hpp +++ b/firmware/application/apps/ui_fileman.hpp @@ -104,6 +104,8 @@ class FileManBaseView : public View { std::vector entry_list{}; std::vector 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 */ diff --git a/firmware/application/bitmap.hpp b/firmware/application/bitmap.hpp index 9b6cb2fe..51a711ff 100644 --- a/firmware/application/bitmap.hpp +++ b/firmware/application/bitmap.hpp @@ -5683,6 +5683,44 @@ static constexpr Bitmap bitmap_icon_trim{ {16, 16}, bitmap_icon_trim_data}; +static constexpr uint8_t bitmap_icon_hide_data[] = { + 0x00, + 0x00, + 0x00, + 0x40, + 0x00, + 0x20, + 0xE0, + 0x17, + 0x18, + 0x18, + 0xC4, + 0x27, + 0x62, + 0x42, + 0x21, + 0x85, + 0xA1, + 0x84, + 0x62, + 0x46, + 0xA4, + 0x23, + 0x18, + 0x18, + 0xE8, + 0x07, + 0x04, + 0x00, + 0x02, + 0x00, + 0x00, + 0x00, +}; +static constexpr Bitmap bitmap_icon_hide{ + {16, 16}, + bitmap_icon_hide_data}; + } /* namespace ui */ #endif /*__BITMAP_HPP__*/ diff --git a/firmware/graphics/icon_hide.png b/firmware/graphics/icon_hide.png new file mode 100644 index 0000000000000000000000000000000000000000..7804b1eaba5b4759d9d3806d8d09e9320bd7051b GIT binary patch literal 202 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5M?jcysy3fAP_V|+ z#WBR9cWKZ;u>%SmO!5E!pMLj5&N6pxp@^an=YfyRWm+ZQi`b39=LmnZ zK-S^e9|M9~LyJG$%GNeKxqDqr4-><*qj$3{1FuYresM-LY-jq%uI)C#eG$2CXE`mO w-ZkA;eqm|gyTEQ1Yx%H+dz$rU{CmJ6?q3_HSR()QDbO7Zp00i_>zopr06+sukpKVy literal 0 HcmV?d00001