From 5c91a2e36b04468aac36b1eaf486fe4b0908179b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Thu, 27 Mar 2014 07:19:58 -0700 Subject: [PATCH] Don't animate the progress bar when moving backwards --- src/dialog_progress.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/dialog_progress.cpp b/src/dialog_progress.cpp index 0d5312a5a..7ccfbc23c 100644 --- a/src/dialog_progress.cpp +++ b/src/dialog_progress.cpp @@ -199,7 +199,12 @@ void DialogProgress::OnShow(wxShowEvent&) { } void DialogProgress::OnIdle(wxIdleEvent&) { - if (progress_current != progress_target) { + if (progress_current > progress_target) { + progress_current = progress_target; + gauge->SetValue(progress_current); + set_taskbar_progress(progress_current / 3); + } + else if (progress_current < progress_target) { using namespace std::chrono; auto now = steady_clock::now(); int ms = mid(0, duration_cast(now - progress_anim_start_time).count(), progress_anim_duration);