FileManager: Add an animation for deleting files

This commit is contained in:
Jason 2022-02-05 14:19:10 -05:00 committed by Linus Groh
parent e53117a9b9
commit cdcf097aa8
Notes: sideshowbarker 2024-07-17 19:45:59 +09:00
2 changed files with 9 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,012 B

View file

@ -26,7 +26,6 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
auto& button = *find_descendant_of_type_named<GUI::Button>("button");
// FIXME: Show a different animation for deletions
auto& file_copy_animation = *find_descendant_of_type_named<GUI::ImageWidget>("file_copy_animation");
file_copy_animation.load_from_file("/res/graphics/file-flying-animation.gif");
file_copy_animation.animate();
@ -35,7 +34,15 @@ FileOperationProgressWidget::FileOperationProgressWidget(FileOperation operation
source_folder_icon.load_from_file("/res/icons/32x32/filetype-folder-open.png");
auto& destination_folder_icon = *find_descendant_of_type_named<GUI::ImageWidget>("destination_folder_icon");
destination_folder_icon.load_from_file("/res/icons/32x32/filetype-folder-open.png");
switch (m_operation) {
case FileOperation::Delete:
destination_folder_icon.load_from_file("/res/icons/32x32/recycle-bin.png");
break;
default:
destination_folder_icon.load_from_file("/res/icons/32x32/filetype-folder-open.png");
break;
}
button.on_click = [this](auto) {
close_pipe();