mirror of
https://github.com/radareorg/radare2.git
synced 2025-04-01 17:11:51 +00:00
Use utf8 block character in progressbar
This commit is contained in:
parent
a585dbc2d9
commit
830889bb88
@ -1555,6 +1555,9 @@ R_API void r_print_progressbar(RPrint *p, int pc, int _cols) {
|
||||
if (!p) {
|
||||
p = &staticp;
|
||||
}
|
||||
const char *h_line = p->cons->use_utf8 ? RUNE_LONG_LINE_HORIZ : "-";
|
||||
const char *block = p->cons->use_utf8 ? UTF_BLOCK : "#";
|
||||
|
||||
pc = R_MAX (0, R_MIN (100, pc));
|
||||
if (p->flags & R_PRINT_FLAGS_HEADER) {
|
||||
p->cb_printf ("%4d%% ", pc);
|
||||
@ -1562,10 +1565,10 @@ R_API void r_print_progressbar(RPrint *p, int pc, int _cols) {
|
||||
cols -= 15;
|
||||
p->cb_printf ("[");
|
||||
for (i = cols * pc / 100; i; i--) {
|
||||
p->cb_printf ("#");
|
||||
p->cb_printf (block);
|
||||
}
|
||||
for (i = cols - (cols * pc / 100); i; i--) {
|
||||
p->cb_printf ("-");
|
||||
p->cb_printf (h_line);
|
||||
}
|
||||
p->cb_printf ("]");
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user