mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-22 22:41:10 -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"*")) {
|
for (const auto& entry : fs::directory_iterator(dir_path, u"*")) {
|
||||||
// Hide files starting with '.' (hidden / tmp).
|
// Hide files starting with '.' (hidden / tmp).
|
||||||
if (is_hidden_file(entry.path()))
|
if (!show_hidden_files && is_hidden_file(entry.path()))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (fs::is_regular_file(entry.status())) {
|
if (fs::is_regular_file(entry.status())) {
|
||||||
|
@ -568,6 +568,7 @@ FileManagerView::FileManagerView(
|
||||||
&button_open_notepad,
|
&button_open_notepad,
|
||||||
&button_rename_timestamp,
|
&button_rename_timestamp,
|
||||||
&button_open_iq_trim,
|
&button_open_iq_trim,
|
||||||
|
&button_show_hidden_files,
|
||||||
});
|
});
|
||||||
|
|
||||||
menu_view.on_highlight = [this]() {
|
menu_view.on_highlight = [this]() {
|
||||||
|
@ -658,6 +659,12 @@ FileManagerView::FileManagerView(
|
||||||
} else
|
} else
|
||||||
nav_.display_modal("IQ Trim", "Not a capture file.");
|
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
|
} // namespace ui
|
||||||
|
|
|
@ -104,6 +104,8 @@ class FileManBaseView : public View {
|
||||||
std::vector<fileman_entry> entry_list{};
|
std::vector<fileman_entry> entry_list{};
|
||||||
std::vector<uint32_t> saved_index_stack{};
|
std::vector<uint32_t> saved_index_stack{};
|
||||||
|
|
||||||
|
bool show_hidden_files{false};
|
||||||
|
|
||||||
Labels labels{
|
Labels labels{
|
||||||
{{0, 0}, "Path:", Color::light_grey()}};
|
{{0, 0}, "Path:", Color::light_grey()}};
|
||||||
|
|
||||||
|
@ -278,6 +280,12 @@ class FileManagerView : public FileManBaseView {
|
||||||
{},
|
{},
|
||||||
&bitmap_icon_trim,
|
&bitmap_icon_trim,
|
||||||
Color::orange()};
|
Color::orange()};
|
||||||
|
|
||||||
|
NewButton button_show_hidden_files{
|
||||||
|
{13 * 8, 34 * 8, 4 * 8, 32},
|
||||||
|
{},
|
||||||
|
&bitmap_icon_hide,
|
||||||
|
Color::dark_grey()};
|
||||||
};
|
};
|
||||||
|
|
||||||
} /* namespace ui */
|
} /* namespace ui */
|
||||||
|
|
|
@ -5683,6 +5683,44 @@ static constexpr Bitmap bitmap_icon_trim{
|
||||||
{16, 16},
|
{16, 16},
|
||||||
bitmap_icon_trim_data};
|
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 */
|
} /* namespace ui */
|
||||||
|
|
||||||
#endif /*__BITMAP_HPP__*/
|
#endif /*__BITMAP_HPP__*/
|
||||||
|
|
BIN
firmware/graphics/icon_hide.png
Normal file
BIN
firmware/graphics/icon_hide.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 202 B |
Loading…
Add table
Add a link
Reference in a new issue