FileManager: Show file copying animation

Bring some mid-90s charm and show a file flying animation while copying
files.  Icons for both source and destination directories are currently
the default icons, but in the future they could be the respective icons
for the destination directory.
This commit is contained in:
Leandro Pereira 2021-04-16 18:39:35 -07:00 committed by Linus Groh
commit 8d25290198
Notes: sideshowbarker 2024-07-18 19:32:07 +09:00
4 changed files with 31 additions and 1 deletions

View file

@ -29,6 +29,7 @@
#include <LibCore/File.h>
#include <LibCore/Notifier.h>
#include <LibGUI/Button.h>
#include <LibGUI/ImageWidget.h>
#include <LibGUI/Label.h>
#include <LibGUI/MessageBox.h>
#include <LibGUI/Progressbar.h>
@ -43,6 +44,16 @@ FileOperationProgressWidget::FileOperationProgressWidget(NonnullRefPtr<Core::Fil
auto& button = *find_descendant_of_type_named<GUI::Button>("button");
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();
auto& source_folder_icon = *find_descendant_of_type_named<GUI::ImageWidget>("source_folder_icon");
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");
button.on_click = [this] {
close_pipe();
window()->close();