From bd1fc6bcd5b1de352003d90828dff06b7038a225 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Sun, 19 Feb 2023 11:42:07 +0100 Subject: [PATCH] Better progress UI --- src/client/updater/updater_ui.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/client/updater/updater_ui.cpp b/src/client/updater/updater_ui.cpp index 54a80b13..f042b4a8 100644 --- a/src/client/updater/updater_ui.cpp +++ b/src/client/updater/updater_ui.cpp @@ -31,9 +31,16 @@ namespace updater { std::lock_guard _{this->mutex_}; - this->progress_ui_.set_progress(1, 1); + const auto total_size = this->get_total_size(); + this->update_file_name(); + // Updater UI seems to be delayed a bit, so this triggers proper progress + this->progress_ui_.set_progress(total_size > 1 ? total_size - 1 : 0, total_size); + std::this_thread::sleep_for(100ms); + + this->progress_ui_.set_progress(total_size, total_size); + this->total_files_.clear(); this->downloaded_files_.clear(); this->downloading_files_.clear();