Skip to content

Commit

Permalink
Merge pull request traviscross#53 from dballing/master
Browse files Browse the repository at this point in the history
Made the '?' bold-red
  • Loading branch information
rewolff committed Jul 14, 2014
2 parents fb5ec53 + 0b16d67 commit 1841fa1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions curses.c
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,17 @@ void mtr_curses_init() {
}


static int block_col[NUM_FACTORS] =
static int block_col[NUM_FACTORS+1] =
{ // 1:black 2:red 3:green 4:brown/yellow 5:blue 6:magenta 7:cyan 8:white
COLOR_PAIR(2)|A_BOLD,
A_NORMAL,
COLOR_PAIR(3),
COLOR_PAIR(3)|A_BOLD,
COLOR_PAIR(4)|A_BOLD,
COLOR_PAIR(6)|A_BOLD,
COLOR_PAIR(6),
COLOR_PAIR(2),
COLOR_PAIR(2)|A_BOLD,
COLOR_PAIR(2)|A_BOLD
};

void mtr_print_scaled(int ms)
Expand All @@ -508,7 +509,7 @@ void mtr_print_scaled(int ms)

for (i = 0; i < NUM_FACTORS; i++) {
if (ms <= scale[i]) {
attrset(block_col[i]);
attrset(block_col[i+1]);
printw("%c", block_map[i]);
attrset(A_NORMAL);
return;
Expand All @@ -528,9 +529,9 @@ void mtr_fill_graph(int at, int cols)
if (saved[i] == -2) {
printw(" ");
} else if (saved[i] == -1) {
attron(A_BOLD);
printw("?");
attroff(A_BOLD);
attrset(block_col[0]);
printw("%c", '?');
attrset(A_NORMAL);
} else {
if (display_mode == 1) {
if (saved[i] > scale[6]) {
Expand Down Expand Up @@ -679,13 +680,13 @@ void mtr_curses_redraw(void)

for (i = 0; i < NUM_FACTORS-1; i++) {
printw(" ");
attrset(block_col[i]);
attrset(block_col[i+1]);
printw("%c", block_map[i]);
attrset(A_NORMAL);
printw(":%d ms", block_map[i], scale[i]/1000);
}
printw(" ");
attrset(block_col[NUM_FACTORS-1]);
attrset(block_col[NUM_FACTORS]);
printw("%c", block_map[NUM_FACTORS-1]);
attrset(A_NORMAL);
}
Expand Down

0 comments on commit 1841fa1

Please sign in to comment.