mirror of
https://github.com/RGBCube/serenity
synced 2025-05-28 22:15:07 +00:00
Browser: Show download progress in the taskbar if available
This commit is contained in:
parent
853d900ee8
commit
1a15ca2de4
1 changed files with 5 additions and 2 deletions
|
@ -129,10 +129,13 @@ DownloadWidget::~DownloadWidget()
|
|||
void DownloadWidget::did_progress(Optional<u32> total_size, u32 downloaded_size)
|
||||
{
|
||||
m_progress_bar->set_min(0);
|
||||
if (total_size.has_value())
|
||||
if (total_size.has_value()) {
|
||||
int percent = roundf(((float)downloaded_size / (float)total_size.value()) * 100.0f);
|
||||
window()->set_progress(percent);
|
||||
m_progress_bar->set_max(total_size.value());
|
||||
else
|
||||
} else {
|
||||
m_progress_bar->set_max(0);
|
||||
}
|
||||
m_progress_bar->set_value(downloaded_size);
|
||||
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue