mirror of
https://github.com/flatpak/flatpak.git
synced 2026-05-24 08:51:27 -04:00
cli: Limit length of progress bar
This limits the witdh of the progress bar, because it looked really weird on a wide terminal and kept changing width as the text at the end (speed, time left, etc) changed. It is now never more than 20 chars wide, which is fine with the new increase in fidelity using unicode blocks. Closes: #2449 Approved by: alexlarsson
This commit is contained in:
committed by
Atomic Bot
parent
4514286596
commit
830a750d20
@@ -288,7 +288,7 @@ progress_changed_cb (FlatpakTransactionProgress *progress,
|
||||
|
||||
spin_op_progress (cli, op);
|
||||
|
||||
bar_length = cli->table_width - (strlen (cli->progress_msg) + 4 + 4 + cli->speed_len);
|
||||
bar_length = MIN (20, cli->table_width - (strlen (cli->progress_msg) + 4 + 4 + cli->speed_len));
|
||||
|
||||
n_full = (bar_length * percent) / 100;
|
||||
partial = (((bar_length * percent) % 100) * G_N_ELEMENTS(partial_blocks) ) / 100;
|
||||
|
||||
Reference in New Issue
Block a user