diff options
author | dec05eba <dec05eba@protonmail.com> | 2023-06-13 21:36:02 +0200 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2023-06-13 21:36:02 +0200 |
commit | 613016a48d9b10fb81f5bc54b0bdd463c39f5283 (patch) | |
tree | 1c909df3dca6e4551b2da37965c9f94c706d484b /src/plugins | |
parent | 3554a838c2318863f59ad4b50a17edc19b5cb94a (diff) |
Add option to disable file manager grid view to make midov stop crying
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/FileManager.cpp | 11 | ||||
-rw-r--r-- | src/plugins/Matrix.cpp | 2 |
2 files changed, 8 insertions, 5 deletions
diff --git a/src/plugins/FileManager.cpp b/src/plugins/FileManager.cpp index 6f16b0a..c731ec2 100644 --- a/src/plugins/FileManager.cpp +++ b/src/plugins/FileManager.cpp @@ -2,6 +2,7 @@ #include "../../include/FileAnalyzer.hpp" #include "../../include/ResourceLoader.hpp" #include "../../include/Theme.hpp" +#include "../../include/Config.hpp" #include "../../include/Storage.hpp" #include "../../include/QuickMedia.hpp" @@ -54,7 +55,7 @@ namespace QuickMedia { return result; set_last_accessed_dir(current_dir); - auto body = create_body(false, true); + auto body = create_body(false, get_config().file_manager.grid_view); body->set_items(std::move(result_items)); result_tabs.push_back(Tab{std::move(body), nullptr, nullptr}); return PluginResult::OK; @@ -86,9 +87,11 @@ namespace QuickMedia { if(current_dir != "/") { auto parent_item = BodyItem::create("Go to parent directory"); parent_item->url = ".."; - parent_item->thumbnail_is_local = true; - parent_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/folder.png"); - parent_item->thumbnail_size = mgl::vec2i(64, 64); + if(get_config().file_manager.grid_view) { + parent_item->thumbnail_is_local = true; + parent_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/folder.png"); + parent_item->thumbnail_size = mgl::vec2i(64, 64); + } result_items.push_back(std::move(parent_item)); } diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index 16dd098..b9fbea0 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -1295,7 +1295,7 @@ namespace QuickMedia { return std::vector<Tab>{}; }; - auto file_manager_body = create_body(false, true); + auto file_manager_body = create_body(false, get_config().file_manager.grid_view); auto file_manager_page = std::make_unique<FileManagerPage>(program, FILE_MANAGER_MIME_TYPE_IMAGE, std::move(submit_handler)); file_manager_page->set_current_directory(get_home_dir().data); BodyItems body_items; |