mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-30 04:39:06 +00:00
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:
parent
eee8352494
commit
8d25290198
Notes:
sideshowbarker
2024-07-18 19:32:07 +09:00
Author: https://github.com/lpereira 🔰
Commit: 8d25290198
Pull-request: https://github.com/SerenityOS/serenity/pull/6395
4 changed files with 31 additions and 1 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue