mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-05-01 12:07:14 +02: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:
committed by
Linus Groh
parent
eee8352494
commit
8d25290198
Notes:
sideshowbarker
2024-07-18 19:32:07 +09:00
Author: https://github.com/lpereira 🔰 Commit: https://github.com/SerenityOS/serenity/commit/8d252901985 Pull-request: https://github.com/SerenityOS/serenity/pull/6395
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user