From e095a482a02301ae39d1468a6096a1516a2ed6ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrien=20Gallou=C3=ABt?= Date: Fri, 10 Apr 2026 08:24:53 +0200 Subject: [PATCH] common : add fluidity to the progress bar (#21671) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Adrien Gallouët --- common/download.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/download.cpp b/common/download.cpp index 055f0038f4..561164591f 100644 --- a/common/download.cpp +++ b/common/download.cpp @@ -174,7 +174,7 @@ public: } int lines_up = max_line - lines[this]; - size_t bar = 55 - len; + size_t bar = (55 - len) * 2; size_t pct = (100 * current) / total; size_t pos = (bar * current) / total; @@ -183,8 +183,8 @@ public: } std::cout << '\r' << "Downloading " << filename << " "; - for (size_t i = 0; i < bar; ++i) { - std::cout << (i < pos ? "—" : " "); + for (size_t i = 0; i < bar; i += 2) { + std::cout << (i + 1 < pos ? "─" : (i < pos ? "╴" : " ")); } std::cout << std::setw(4) << pct << "%\033[K";