Skip to content

Commit c5839b9

Browse files
FranciscoTGouveiadjc
authored andcommitted
progress: modify progress bar's states to be column-aligned
1 parent 829fa3c commit c5839b9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/dist/download.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl<'a> DownloadCfg<'a> {
194194
let progress = ProgressBar::hidden();
195195
progress.set_style(
196196
ProgressStyle::with_template(
197-
"{msg:>12.bold} [{bar:40}] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})",
197+
"{msg:>12.bold} [{bar:30}] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})",
198198
)
199199
.unwrap()
200200
.progress_chars("## "),
@@ -260,7 +260,7 @@ impl DownloadStatus {
260260
*retry_time = None;
261261
self.progress.set_style(
262262
ProgressStyle::with_template(
263-
"{msg:>12.bold} [{bar:40}] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})",
263+
"{msg:>12.bold} [{bar:30}] {bytes}/{total_bytes} ({bytes_per_sec}, ETA: {eta})",
264264
)
265265
.unwrap()
266266
.progress_chars("## "),
@@ -269,7 +269,7 @@ impl DownloadStatus {
269269

270270
pub(crate) fn finished(&self) {
271271
self.progress.set_style(
272-
ProgressStyle::with_template("{msg:>12.bold} pending installation")
272+
ProgressStyle::with_template("{msg:>12.bold} pending installation {total_bytes:>10}")
273273
.unwrap(),
274274
);
275275
self.progress.tick(); // A tick is needed for the new style to appear, as it is static.
@@ -293,7 +293,7 @@ impl DownloadStatus {
293293
pub(crate) fn installing(&self) {
294294
self.progress.set_style(
295295
ProgressStyle::with_template(
296-
"{msg:>12.bold} installing {spinner:.green}",
296+
"{msg:>12.bold} installing {spinner:.green} {total_bytes:>18}",
297297
)
298298
.unwrap()
299299
.tick_chars(r"|/-\ "),
@@ -303,7 +303,7 @@ impl DownloadStatus {
303303

304304
pub(crate) fn installed(&self) {
305305
self.progress.set_style(
306-
ProgressStyle::with_template("{msg:>12.bold} installed").unwrap(),
306+
ProgressStyle::with_template("{msg:>12.bold} installed {total_bytes:>21}").unwrap(),
307307
);
308308
self.progress.finish();
309309
}

0 commit comments

Comments
 (0)