aboutsummaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2023-06-11 21:52:59 +0200
committerdec05eba <dec05eba@protonmail.com>2023-06-11 21:52:59 +0200
commitcdddd4250c0fd6cb6b8e0fe7f8810a83df7d48c4 (patch)
treea9d3460d20895028f77fb4dba79550cd1e073ca6 /src/plugins
parentfd402fc4ea57eababbe5e568835e7b5e070bd0c0 (diff)
Change file manager view to grid, change file and folder icons
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/FileManager.cpp16
-rw-r--r--src/plugins/Matrix.cpp2
2 files changed, 13 insertions, 5 deletions
diff --git a/src/plugins/FileManager.cpp b/src/plugins/FileManager.cpp
index 45c61bf..6f16b0a 100644
--- a/src/plugins/FileManager.cpp
+++ b/src/plugins/FileManager.cpp
@@ -54,7 +54,7 @@ namespace QuickMedia {
return result;
set_last_accessed_dir(current_dir);
- auto body = create_body();
+ auto body = create_body(false, true);
body->set_items(std::move(result_items));
result_tabs.push_back(Tab{std::move(body), nullptr, nullptr});
return PluginResult::OK;
@@ -86,6 +86,9 @@ 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);
result_items.push_back(std::move(parent_item));
}
@@ -104,6 +107,8 @@ namespace QuickMedia {
file_mime_type = FILE_MANAGER_MIME_TYPE_IMAGE;
else if(is_video_ext(ext))
file_mime_type = FILE_MANAGER_MIME_TYPE_VIDEO;
+ else if(is_music_ext(ext))
+ file_mime_type = FILE_MANAGER_MIME_TYPE_AUDIO;
}
if(is_regular_file && !(mime_type & file_mime_type))
@@ -116,12 +121,15 @@ namespace QuickMedia {
body_item->thumbnail_url = p.first.path().string();
} else {
body_item->thumbnail_is_local = true;
- if(is_regular_file) {
+ if(file_mime_type == FILE_MANAGER_MIME_TYPE_AUDIO) {
+ body_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/audio.png");
+ body_item->thumbnail_size = mgl::vec2i(64, 64);
+ } else if(is_regular_file) {
body_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/file.png");
- body_item->thumbnail_size = mgl::vec2i(18, 24);
+ body_item->thumbnail_size = mgl::vec2i(64, 64);
} else {
body_item->thumbnail_url = get_resource_loader_root_path() + std::string("images/folder.png");
- body_item->thumbnail_size = mgl::vec2i(24, 22);
+ body_item->thumbnail_size = mgl::vec2i(64, 64);
}
}
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index c59a819..127a664 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();
+ auto file_manager_body = create_body(false, true);
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;