fix:下载取消后下载进度仍然在widget中显示

This commit is contained in:
柚子 2022-12-13 21:37:40 +08:00
parent 68d91f71ba
commit a27c8b9ace
2 changed files with 8 additions and 1 deletions

View File

@ -90,6 +90,11 @@ void ProgressButton::setProgress(int progress)
{ {
buttonState = state::openProgress; buttonState = state::openProgress;
ProgressButton::progress = progress; ProgressButton::progress = progress;
if(progress == 0)
{
buttonState = state::normal;
update();
}
if(progress == 100) if(progress == 100)
{ {
buttonState = state::closeProgress; buttonState = state::closeProgress;

View File

@ -44,7 +44,9 @@ DownloadListWidget::DownloadListWidget(QWidget *parent) :
size2 = download_size; size2 = download_size;
} }
if(isdownload){ if(isdownload){
downloaditemlist[nowDownload - 1]->setSpeed(theSpeed); downloaditemlist[nowDownload - 1]->setSpeed(theSpeed);
}else{
emit downloadProgress(0);
} }
}); });
} }