mirror of
https://github.com/SerenityOS/serenity
synced 2024-10-15 04:13:11 +00:00
Browser: Add download finished graphics to download widget
Not the prettiest, but visually indicates that the download has finished successfully.
This commit is contained in:
parent
29cce65d2f
commit
4faff69974
BIN
Base/res/graphics/download-finished.gif
Normal file
BIN
Base/res/graphics/download-finished.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 2 KiB |
|
@ -68,8 +68,8 @@ DownloadWidget::DownloadWidget(const URL& url)
|
|||
animation_container.set_fixed_height(32);
|
||||
auto& animation_layout = animation_container.set_layout<GUI::HorizontalBoxLayout>();
|
||||
|
||||
auto& browser_image = animation_container.add<GUI::ImageWidget>();
|
||||
browser_image.load_from_file("/res/graphics/download-animation.gif");
|
||||
m_browser_image = animation_container.add<GUI::ImageWidget>();
|
||||
m_browser_image->load_from_file("/res/graphics/download-animation.gif");
|
||||
animation_layout.add_spacer();
|
||||
|
||||
auto& source_label = add<GUI::Label>(String::formatted("From: {}", url));
|
||||
|
@ -156,6 +156,8 @@ void DownloadWidget::did_finish(bool success)
|
|||
{
|
||||
dbgln("did_finish, success={}", success);
|
||||
|
||||
m_browser_image->load_from_file("/res/graphics/download-finished.gif");
|
||||
window()->set_title("Download finished!");
|
||||
m_close_button->set_enabled(true);
|
||||
m_cancel_button->set_text("Open in Folder");
|
||||
m_cancel_button->on_click = [this](auto) {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
#include <AK/URL.h>
|
||||
#include <LibCore/ElapsedTimer.h>
|
||||
#include <LibCore/FileStream.h>
|
||||
#include <LibGUI/ImageWidget.h>
|
||||
#include <LibGUI/Progressbar.h>
|
||||
#include <LibGUI/Widget.h>
|
||||
#include <LibProtocol/Request.h>
|
||||
|
@ -35,6 +36,7 @@ private:
|
|||
RefPtr<GUI::Button> m_cancel_button;
|
||||
RefPtr<GUI::Button> m_close_button;
|
||||
RefPtr<GUI::CheckBox> m_close_on_finish_checkbox;
|
||||
RefPtr<GUI::ImageWidget> m_browser_image;
|
||||
OwnPtr<Core::OutputFileStream> m_output_file_stream;
|
||||
Core::ElapsedTimer m_elapsed_timer;
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue