Skip to content

Commit

Permalink
Pulse progress bar after manual cancellation
Browse files Browse the repository at this point in the history
  • Loading branch information
vslavik committed May 23, 2024
1 parent eea7cb8 commit 5296735
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/progressinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,8 @@ void ProgressWindow::update_progress(double completedFraction)
dispatch::on_main([=]
{
auto value = std::min((int)std::lround(completedFraction * PROGRESS_BAR_RANGE), PROGRESS_BAR_RANGE);
if (m_cancellationToken && m_cancellationToken->is_cancelled())
return; // don't update anymore
m_gauge->SetValue(value);
});
}
Expand All @@ -317,5 +319,6 @@ void ProgressWindow::OnCancel(wxCommandEvent&)
{
((wxButton*)FindWindow(wxID_CANCEL))->Enable(false);
UpdateMessage(_(L"Cancelling…"));
m_gauge->Pulse();
m_cancellationToken->cancel();
}

0 comments on commit 5296735

Please sign in to comment.