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 22, 2024
1 parent eea7cb8 commit 90c3eec
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/progressinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +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);
m_gauge->SetValue(value);
if (!m_cancellationToken->is_cancelled())
m_gauge->SetValue(value);
});
}

Expand All @@ -317,5 +318,6 @@ void ProgressWindow::OnCancel(wxCommandEvent&)
{
((wxButton*)FindWindow(wxID_CANCEL))->Enable(false);
UpdateMessage(_(L"Cancelling…"));
m_gauge->Pulse();
m_cancellationToken->cancel();
}

0 comments on commit 90c3eec

Please sign in to comment.